diff options
author | Chocobozzz <me@florianbigard.com> | 2021-06-02 18:15:41 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-06-02 18:15:41 +0200 |
commit | e030bfb59dd5ee65f20a64686ec9b22ca39f70ae (patch) | |
tree | c9a439159ef540291e3c030bcaf958b953442147 /server/middlewares/doc.ts | |
parent | 463206948d6a9d46e7e68d55c7b763e601ecc870 (diff) | |
download | PeerTube-e030bfb59dd5ee65f20a64686ec9b22ca39f70ae.tar.gz PeerTube-e030bfb59dd5ee65f20a64686ec9b22ca39f70ae.tar.zst PeerTube-e030bfb59dd5ee65f20a64686ec9b22ca39f70ae.zip |
Refactor server errors handler
Diffstat (limited to 'server/middlewares/doc.ts')
-rw-r--r-- | server/middlewares/doc.ts | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/server/middlewares/doc.ts b/server/middlewares/doc.ts new file mode 100644 index 000000000..aa852cd77 --- /dev/null +++ b/server/middlewares/doc.ts | |||
@@ -0,0 +1,13 @@ | |||
1 | import * as express from 'express' | ||
2 | |||
3 | function docMiddleware (docUrl: string) { | ||
4 | return (req: express.Request, res: express.Response, next: express.NextFunction) => { | ||
5 | res.locals.docUrl = docUrl | ||
6 | |||
7 | if (next) return next() | ||
8 | } | ||
9 | } | ||
10 | |||
11 | export { | ||
12 | docMiddleware | ||
13 | } | ||