jqab/web/index.js
2019-04-05 22:48:34 +02:00

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}`)
})