Enable CORS
This commit is contained in:
parent
a9c10851d6
commit
e5245d82a0
2 changed files with 4 additions and 0 deletions
|
@ -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",
|
||||
|
|
|
@ -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'), {}));
|
||||
|
|
Loading…
Reference in a new issue