박권수

feat. cors

const Koa = require('koa');
const cors = require('@koa/cors');
const Router = require('koa-router');
const bodyparser = require('koa-bodyparser');
......@@ -29,6 +30,7 @@ Mongoose.connect(MONGO_URL, {
app.use(bodyparser());
router.use('/api', api.routes());
app.use(cors());
app.use(router.routes()).use(router.allowedMethods());
app.listen(SERVER_PORT, () => {
......
......@@ -17,6 +17,7 @@
"author": "박권수",
"license": "ISC",
"dependencies": {
"@koa/cors": "^3.1.0",
"moment": "^2.29.1",
"mqtt": "^4.2.6"
},
......
This diff is collapsed. Click to expand it.