diff --git a/.gitignore b/.gitignore index e920c16..c9851a9 100644 --- a/.gitignore +++ b/.gitignore @@ -31,3 +31,5 @@ node_modules # Optional REPL history .node_repl_history + +site/ diff --git a/server.js b/server.js new file mode 100644 index 0000000..978474e --- /dev/null +++ b/server.js @@ -0,0 +1,21 @@ +const express = require('express'); + +const PORT = process.env.PORT; +const serveDir = __dirname + '/site/'; + +const expressConfig = { + dotfiles: 'deny', + index: false, + redirect: true +}; + +const app = express(); + +app.use( + express.static(serveDir, expressConfig) +); + +const server = app.listen(PORT, function () { + const serverPort = server.address().port; + console.log('Server started on port ' + serverPort); +});