This commit is contained in:
theluyuan 2021-09-28 11:43:13 +08:00
parent 8d503119a6
commit 16b170dfcf
2 changed files with 3 additions and 0 deletions

2
app.js
View File

@ -5,6 +5,8 @@ dbs = require("./bin/mongodb.js")('mongodb://localhost:27017',"xiangqin")
// console.log(requter) // console.log(requter)
// import requter from "./bin/router" // import requter from "./bin/router"
const app = new Koa(); const app = new Koa();
const serve = require("koa-static")
app.use(serve(path.join(__dirname, '/images')));
app.use(koaJwt({ secret: 'gjhkhnjweuyujhgjh' }).unless({ path: [/^\/sign/,/^\/login/,/^\/images/,/^\/upload/] })); app.use(koaJwt({ secret: 'gjhkhnjweuyujhgjh' }).unless({ path: [/^\/sign/,/^\/login/,/^\/images/,/^\/upload/] }));
// app.use(async (ctx, next) => { // app.use(async (ctx, next) => {

View File

@ -16,6 +16,7 @@
"koa-bodyparser": "^4.2.1", "koa-bodyparser": "^4.2.1",
"koa-jwt": "^4.0.3", "koa-jwt": "^4.0.3",
"koa-router": "^7.4.0", "koa-router": "^7.4.0",
"koa-static": "^5.0.0",
"mongodb": "^3.3.5" "mongodb": "^3.3.5"
} }
} }