mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-05 19:42:24 +02:00
server/server -> server/core
This commit is contained in:
parent
114327d4ce
commit
5a3d0650c9
838 changed files with 111 additions and 111 deletions
16
server/core/middlewares/doc.ts
Normal file
16
server/core/middlewares/doc.ts
Normal file
|
@ -0,0 +1,16 @@
|
|||
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
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue