Enable CORS
This commit is contained in:
parent
a9c10851d6
commit
e5245d82a0
2 changed files with 4 additions and 0 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue