From ac6ce5c7d95347c5712e4e6c0620db642d4c9670 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Acid=20Chicken=20=28=E7=A1=AB=E9=85=B8=E9=B6=8F=29?= Date: Fri, 1 Feb 2019 19:46:18 +0900 Subject: [PATCH] Module '@koa/cors' as import syntax (#4060) --- package.json | 1 + src/server/api/index.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 7f23d033a..98bcb51fa 100644 --- a/package.json +++ b/package.json @@ -50,6 +50,7 @@ "@types/koa": "2.0.48", "@types/koa-bodyparser": "5.0.2", "@types/koa-compress": "2.0.8", + "@types/koa-cors": "0.0.0", "@types/koa-favicon": "2.0.19", "@types/koa-logger": "3.1.1", "@types/koa-mount": "3.0.1", diff --git a/src/server/api/index.ts b/src/server/api/index.ts index 6a10820c8..711e0791e 100644 --- a/src/server/api/index.ts +++ b/src/server/api/index.ts @@ -6,7 +6,7 @@ import * as Koa from 'koa'; import * as Router from 'koa-router'; import * as multer from 'koa-multer'; import * as bodyParser from 'koa-bodyparser'; -const cors = require('@koa/cors'); +import * as cors from '@koa/cors'; import endpoints from './endpoints'; import handler from './api-handler';