aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/doc.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-06-02 18:15:41 +0200
committerChocobozzz <me@florianbigard.com>2021-06-02 18:15:41 +0200
commite030bfb59dd5ee65f20a64686ec9b22ca39f70ae (patch)
treec9a439159ef540291e3c030bcaf958b953442147 /server/middlewares/doc.ts
parent463206948d6a9d46e7e68d55c7b763e601ecc870 (diff)
downloadPeerTube-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.ts13
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 @@
1import * as express from 'express'
2
3function 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
11export {
12 docMiddleware
13}