1
0
Fork 0
peertube/server/middlewares/doc.ts

17 lines
405 B
TypeScript
Raw Normal View History

2021-06-02 12:15:41 -04:00
import * as express from 'express'
function openapiOperationDoc (options: {
url?: string
operationId?: string
}) {
2021-06-02 12:15:41 -04:00
return (req: express.Request, res: express.Response, next: express.NextFunction) => {
res.locals.docUrl = options.url || 'https://docs.joinpeertube.org/api-rest-reference.html#operation/' + options.operationId
2021-06-02 12:15:41 -04:00
if (next) return next()
}
}
export {
openapiOperationDoc
2021-06-02 12:15:41 -04:00
}