This commit is contained in:
robin
2022-04-07 19:33:31 +08:00
parent a593253a63
commit c2f8473fb5
17 changed files with 271 additions and 133 deletions
+14
View File
@@ -0,0 +1,14 @@
'use strict';
module.exports = {
doc : "",
path : "/",
method : ["get", "post"],
middleware: [],
params : {},
return : {},
controller: async (ctx, app) => {
ctx.body = 'index,xe:' + app.utils.VERSION
}
}
+3
View File
@@ -0,0 +1,3 @@
'use strict';
const logger = require('koa-logger')
module.exports = logger()
+11
View File
@@ -0,0 +1,11 @@
'use strict';
/*响应时间*/
module.exports = async (ctx, next, app) => {
// console.log(ctx, next, options);
// const timetaken = `${ctx.request.method}${ctx.request.url} 响应时间`
// console.time(timetaken)
// app.logger.debug("123")
throw new app.err.HttpException
await next()
// console.timeEnd(timetaken)
}