Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
FogNetwork
GitHub Repository: FogNetwork/Tsunami
Path: blob/main/public/games/files/pacman/server.js
1036 views
1
var express = require('express');
2
var app = express();
3
var path = require('path');
4
5
var myLogger = function (req, res, next) {
6
console.log('GET ' + req.path)
7
next()
8
}
9
10
app.use(myLogger);
11
app.use(express.static('.'))
12
13
// viewed at http://localhost:8080
14
app.get('/', function (req, res, next) {
15
res.sendFile(path.join(__dirname + '/index.htm'));
16
});
17
18
var PORT = process.env.PORT || 8080;
19
20
app.listen(PORT, () => console.log('Server started at http://localhost:' + PORT));
21
22