Feature: interactive swagger-ui auto-generated API docs from express (#1812)

* Add interactive swagger-ui auto-generated API docs from express

* Update README.md

* Update index.ts //@ts-ignore

* Fix eslint no-console error

* Add swagger paths

* Add all end  points

* Update swagger.yml

* update swagger yml file

* update swagger config

---------

Co-authored-by: Henry <hzj94@hotmail.com>
This commit is contained in:
Octavian FlowiseAI
2024-08-25 14:22:07 +02:00
committed by GitHub
parent 0f58d31493
commit e8f5f07735
26 changed files with 3123 additions and 270 deletions
+17
View File
@@ -0,0 +1,17 @@
import express, { Request, Response } from 'express'
import swaggerUi from 'swagger-ui-express'
import { swaggerDocs, swaggerExplorerOptions } from './configs/swagger.config'
const app = express()
const port = 6655
app.get('/', (req: Request, res: Response) => {
res.redirect('/api-docs')
})
app.use('/api-docs', swaggerUi.serve, swaggerUi.setup(swaggerDocs, swaggerExplorerOptions))
app.listen(port, () => {
// eslint-disable-next-line no-console
console.log(`Flowise API documentation server listening on port ${port}`)
})