diff --git a/package.json b/package.json index e3a3974..5c200cb 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,9 @@ "color-interpolate": "^1.0.2", "d3": "^4.12.0", "dateformat": "^3.0.2", + "koa": "^2.6.2", + "koa-router": "^7.4.0", + "koa-static": "^5.0.0", "msgflo-browser": "^0.2.0", "plotly.js": "^1.31.2", "skatejs": "^5.0.0-beta.4" diff --git a/server/index.js b/server/index.js new file mode 100644 index 0000000..7730ae6 --- /dev/null +++ b/server/index.js @@ -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); +}