mirror of
https://github.com/ragestudio/linebridge.git
synced 2025-06-09 10:34:17 +00:00
move endpoint to middleware execution
This commit is contained in:
parent
4aa4720e93
commit
69ac40dbd8
@ -113,7 +113,7 @@ class Server {
|
||||
|
||||
query.forEach((middleware) => {
|
||||
if (typeof this.middlewares[middleware] === "function") {
|
||||
this.middlewares[middleware](req, res, next)
|
||||
this.middlewares[middleware](req, res, next, endpoint)
|
||||
}
|
||||
})
|
||||
}
|
||||
@ -163,10 +163,7 @@ class Server {
|
||||
// expose information
|
||||
this.httpServer.use((req, res, next) => {
|
||||
req.requestId = nanoid()
|
||||
req.endpoint = endpoint
|
||||
|
||||
res.setHeader("request_id", req.requestId)
|
||||
|
||||
next()
|
||||
})
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user