]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - server/middlewares/doc.ts
More specific message when signup is not allowed
[github/Chocobozzz/PeerTube.git] / server / middlewares / doc.ts
CommitLineData
41fb13c3 1import express from 'express'
e030bfb5 2
1c627fd8
RK
3function openapiOperationDoc (options: {
4 url?: string
5 operationId?: string
6}) {
e030bfb5 7 return (req: express.Request, res: express.Response, next: express.NextFunction) => {
0c9668f7 8 res.locals.docUrl = options.url || 'https://docs.joinpeertube.org/api-rest-reference.html#operation/' + options.operationId
e030bfb5
C
9
10 if (next) return next()
11 }
12}
13
14export {
1c627fd8 15 openapiOperationDoc
e030bfb5 16}