升级
This commit is contained in:
parent
19ecee362a
commit
5dc5043525
2
app.js
2
app.js
@ -75,7 +75,7 @@ app.use(async (ctx,next)=>{
|
|||||||
|
|
||||||
const bodyParser = require('koa-bodyparser');
|
const bodyParser = require('koa-bodyparser');
|
||||||
app.use(bodyParser());
|
app.use(bodyParser());
|
||||||
// console.log(requter())
|
// console.log(requter().stack)
|
||||||
app.use(requter());
|
app.use(requter());
|
||||||
app.listen(3004);
|
app.listen(3004);
|
||||||
console.log("http://localhost:3004")
|
console.log("http://localhost:3004")
|
@ -6,11 +6,11 @@ function addMapping(router, mapping) {
|
|||||||
if (url.startsWith('GET ')) {
|
if (url.startsWith('GET ')) {
|
||||||
var path = url.substring(4);
|
var path = url.substring(4);
|
||||||
router.get(path, mapping[url]);
|
router.get(path, mapping[url]);
|
||||||
// console.log(`register URL mapping: GET ${path}`);
|
console.log(`register URL mapping: GET ${path}`);
|
||||||
} else if (url.startsWith('POST ')) {
|
} else if (url.startsWith('POST ')) {
|
||||||
var path = url.substring(5);
|
var path = url.substring(5);
|
||||||
router.post(path, mapping[url]);
|
router.post(path, mapping[url]);
|
||||||
// console.log(`register URL mapping: POST ${path}`);
|
console.log(`register URL mapping: POST ${path}`);
|
||||||
} else {
|
} else {
|
||||||
console.log(`invalid URL: ${url}`);
|
console.log(`invalid URL: ${url}`);
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,7 @@ let findlist = async (ctx, next) => {
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
// }
|
// }
|
||||||
|
console.log("/find111")
|
||||||
let pro = []
|
let pro = []
|
||||||
let list = []
|
let list = []
|
||||||
for (let i in reptilelist) {
|
for (let i in reptilelist) {
|
||||||
@ -54,7 +55,7 @@ let findlist = async (ctx, next) => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
console.log(1111)
|
||||||
ctx.body = JSON.stringify(list)
|
ctx.body = JSON.stringify(list)
|
||||||
}
|
}
|
||||||
let section = async (ctx, next) => {
|
let section = async (ctx, next) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user