Initial server setup
This commit is contained in:
parent
81c1ba4cf1
commit
d2707da076
2 changed files with 20 additions and 0 deletions
|
@ -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
17
server/index.js
Normal 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);
|
||||||
|
}
|
Loading…
Reference in a new issue