Initial server setup

This commit is contained in:
Henri Bergius 2018-12-24 13:45:01 +01:00
parent 81c1ba4cf1
commit d2707da076
2 changed files with 20 additions and 0 deletions

View file

@ -16,6 +16,9 @@
"color-interpolate": "^1.0.2", "color-interpolate": "^1.0.2",
"d3": "^4.12.0", "d3": "^4.12.0",
"dateformat": "^3.0.2", "dateformat": "^3.0.2",
"koa": "^2.6.2",
"koa-router": "^7.4.0",
"koa-static": "^5.0.0",
"msgflo-browser": "^0.2.0", "msgflo-browser": "^0.2.0",
"plotly.js": "^1.31.2", "plotly.js": "^1.31.2",
"skatejs": "^5.0.0-beta.4" "skatejs": "^5.0.0-beta.4"

17
server/index.js Normal file
View file

@ -0,0 +1,17 @@
const Koa = require('koa');
const Router = require('koa-router');
const Static = require('koa-static');
const path = require('path');
const app = new Koa();
const router = new Router();
app
.use(router.routes())
.use(router.allowedMethods())
.use(Static(path.resolve(__dirname, '../dist'), {}));
module.exports = app;
if (!module.parent) {
app.listen(8080);
}