diff options
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 | } | ||