11 lines
439 B
JavaScript
11 lines
439 B
JavaScript
|
'use strict'
|
||
|
const finalhandler = require('finalhandler'),
|
||
|
http = require('http'),
|
||
|
serveStatic = require('serve-static'),
|
||
|
serve = serveStatic(__dirname + '/public', { 'index': ['index.html'] }),
|
||
|
server = http.createServer(function onRequest(req, res) {
|
||
|
serve(req, res, finalhandler(req, res))
|
||
|
}).listen(8080, () => {
|
||
|
console.log(`Serving on ${server.address().address}:${server.address().port}`)
|
||
|
})
|