]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - server/middlewares/doc.ts
Translated using Weblate (Icelandic)
[github/Chocobozzz/PeerTube.git] / server / middlewares / doc.ts
1 import express from 'express'
2
3 function openapiOperationDoc (options: {
4 url?: string
5 operationId?: string
6 }) {
7 return (req: express.Request, res: express.Response, next: express.NextFunction) => {
8 res.locals.docUrl = options.url || 'https://docs.joinpeertube.org/api-rest-reference.html#operation/' + options.operationId
9
10 if (next) return next()
11 }
12 }
13
14 export {
15 openapiOperationDoc
16 }