pacman/html/server.js
Adolfo Delorenzo b116d1d6ea first commit
2021-10-11 17:45:00 -06:00

21 lines
482 B
JavaScript

var express = require('express');
var app = express();
var path = require('path');
var myLogger = function (req, res, next) {
console.log('GET ' + req.path)
next()
}
app.use(myLogger);
app.use(express.static('.'))
// viewed at http://localhost:8080
app.get('/', function (req, res, next) {
res.sendFile(path.join(__dirname + '/index.htm'));
});
var PORT = process.env.PORT || 8080;
app.listen(PORT, () => console.log('Server started at http://localhost:' + PORT));