up
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
'use strict';
|
||||
const logger = require('koa-logger')
|
||||
module.exports = logger()
|
||||
@@ -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)
|
||||
}
|
||||
Reference in New Issue
Block a user