Allow CORS

This commit is contained in:
Jonathan Cremin 2015-11-29 14:10:53 +00:00
parent 98576081d4
commit 38139d77d6
3 changed files with 3 additions and 0 deletions

2
app.js
View file

@ -1,6 +1,7 @@
import path from 'path';
import zlib from 'zlib';
import koa from 'koa';
import cors from 'kcors';
import route from 'koa-route';
import logger from 'koa-logger';
import favicon from 'koa-favicon';
@ -27,6 +28,7 @@ const app = koa();
app.use(errorHandler(routes));
app.use(bodyparser());
app.use(cors());
app.use(compress({flush: zlib.Z_SYNC_FLUSH }));
app.use(favicon(path.join(__dirname, '/public/images/favicon.png')));
app.use(logger());

View file

@ -45,6 +45,7 @@
"co": "~4.6.0",
"debug": "~2.2.0",
"jspm": "~0.16.13",
"kcors": "^1.0.1",
"koa": "~1.1.2",
"koa-bodyparser": "~2.0.1",
"koa-compress": "~1.0.8",