diff --git a/app.js b/app.js index 57abb2b..76c8271 100644 --- a/app.js +++ b/app.js @@ -4,6 +4,8 @@ dbs = require("./bin/mongodb.js")('mongodb://localhost:27017/',"ceshikaoshi") // console.log(requter) // import requter from "./bin/router" const app = new Koa(); +const bodyParser = require('koa-bodyparser'); +app.use(bodyParser()); app.use(async (ctx, next) => { // 允许来自所有域名请求 ctx.set("Access-Control-Allow-Origin", "*"); @@ -60,8 +62,7 @@ app.use(async (ctx,next)=>{ }); -const bodyParser = require('koa-bodyparser'); -app.use(bodyParser()); + // console.log(requter()) app.use(requter()); app.listen(3002);