mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 15:00:57 +03:00
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:
committed by
GitHub
parent
0f58d31493
commit
e8f5f07735
@@ -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}`)
|
||||
})
|
||||
Reference in New Issue
Block a user