Enable CORS

This commit is contained in:
Henri Bergius 2018-12-24 14:08:36 +01:00
parent a9c10851d6
commit e5245d82a0
2 changed files with 4 additions and 0 deletions

View file

@ -17,7 +17,9 @@
"color-interpolate": "^1.0.2",
"d3": "^4.12.0",
"dateformat": "^3.0.2",
"isomorphic-fetch": "^2.2.1",
"koa": "^2.6.2",
"koa-cors": "0.0.16",
"koa-router": "^7.4.0",
"koa-static": "^5.0.0",
"msgflo-browser": "^0.2.0",

View file

@ -1,12 +1,14 @@
const Koa = require('koa');
const Router = require('koa-router');
const Static = require('koa-static');
const Cors = require('koa-cors');
const path = require('path');
const app = new Koa();
const router = new Router();
app
.use(Cors())
.use(router.routes())
.use(router.allowedMethods())
.use(Static(path.resolve(__dirname, '../dist'), {}));