]>
Commit | Line | Data |
---|---|---|
e030bfb5 C |
1 | import * as express from 'express' |
2 | ||
1c627fd8 RK |
3 | function openapiOperationDoc (options: { |
4 | url?: string | |
5 | operationId?: string | |
6 | }) { | |
e030bfb5 | 7 | return (req: express.Request, res: express.Response, next: express.NextFunction) => { |
1c627fd8 | 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 | ||
14 | export { | |
1c627fd8 | 15 | openapiOperationDoc |
e030bfb5 | 16 | } |