mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-23 17:00:30 +03:00
e8f5f07735
* 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>
18 lines
541 B
TypeScript
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}`)
|
|
})
|