Init server

This commit is contained in:
2018-07-11 17:56:41 +02:00
commit 49696fbdc8
3 changed files with 349 additions and 0 deletions

20
server.js Normal file
View File

@@ -0,0 +1,20 @@
var express = require('express');
var app = express();
var path = require('path');
app.use("/public", express.static(__dirname + '/public'));
// This responds with "Hello World" on the homepage
app.get('/', function (req, res) {
console.log("Got a GET request for the homepage");
res.sendFile(path.join(__dirname + '/index.html'));
// res.send('Hello GET');
})
var server = app.listen(3000, function () {
var host = server.address().address
var port = server.address().port
console.log("Example app listening at http://%s:%s", host, port);
})