Files
Flowise/packages/api-documentation/src/index.ts
T
Octavian FlowiseAI e8f5f07735 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>
2024-08-25 13:22:07 +01:00

18 lines
541 B
TypeScript

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}`)
})