From 5fa9fd13f282c037007656190fbcd20a4fc869a4 Mon Sep 17 00:00:00 2001 From: luyuan <1162963624@qq.com> Date: Mon, 15 Mar 2021 16:00:55 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20'app.js'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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);