This repository has been archived on 2023-03-26. You can view files and clone it, but cannot push or open issues or pull requests.
tstatic/server.js
2016-05-16 08:37:24 +01:00

21 lines
417 B
JavaScript

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