1
0
Fork 0
peertube/server/core/middlewares/doc.ts
2023-10-04 15:13:25 +02:00

16 lines
400 B
TypeScript

import express from 'express'
function openapiOperationDoc (options: {
url?: string
operationId?: string
}) {
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
if (next) return next()
}
}
export {
openapiOperationDoc
}