doc.ts 400 B

12345678910111213141516
  1. import express from 'express'
  2. function openapiOperationDoc (options: {
  3. url?: string
  4. operationId?: string
  5. }) {
  6. return (req: express.Request, res: express.Response, next: express.NextFunction) => {
  7. res.locals.docUrl = options.url || 'https://docs.joinpeertube.org/api-rest-reference.html#operation/' + options.operationId
  8. if (next) return next()
  9. }
  10. }
  11. export {
  12. openapiOperationDoc
  13. }