mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-06 03:50:26 +02:00
Refactor server errors handler
This commit is contained in:
parent
463206948d
commit
e030bfb59d
20 changed files with 236 additions and 60 deletions
13
server/middlewares/doc.ts
Normal file
13
server/middlewares/doc.ts
Normal file
|
@ -0,0 +1,13 @@
|
|||
import * as express from 'express'
|
||||
|
||||
function docMiddleware (docUrl: string) {
|
||||
return (req: express.Request, res: express.Response, next: express.NextFunction) => {
|
||||
res.locals.docUrl = docUrl
|
||||
|
||||
if (next) return next()
|
||||
}
|
||||
}
|
||||
|
||||
export {
|
||||
docMiddleware
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue