mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 19:00:59 +03:00
add rateLimiter to prediction
This commit is contained in:
@@ -660,9 +660,14 @@ export class App {
|
|||||||
// ----------------------------------------
|
// ----------------------------------------
|
||||||
|
|
||||||
// Send input message and get prediction result (External)
|
// Send input message and get prediction result (External)
|
||||||
this.app.post('/api/v1/prediction/:id', upload.array('files'), async (req: Request, res: Response) => {
|
this.app.post(
|
||||||
|
'/api/v1/prediction/:id',
|
||||||
|
upload.array('files'),
|
||||||
|
(req: Request, res: Response, next: NextFunction) => getRateLimiter(req, res, next),
|
||||||
|
async (req: Request, res: Response) => {
|
||||||
await this.processPrediction(req, res, socketIO)
|
await this.processPrediction(req, res, socketIO)
|
||||||
})
|
}
|
||||||
|
)
|
||||||
|
|
||||||
// Send input message and get prediction result (Internal)
|
// Send input message and get prediction result (Internal)
|
||||||
this.app.post('/api/v1/internal-prediction/:id', async (req: Request, res: Response) => {
|
this.app.post('/api/v1/internal-prediction/:id', async (req: Request, res: Response) => {
|
||||||
@@ -765,7 +770,6 @@ export class App {
|
|||||||
'/api/v1/rate-limit/:id',
|
'/api/v1/rate-limit/:id',
|
||||||
upload.array('files'),
|
upload.array('files'),
|
||||||
(req: Request, res: Response, next: NextFunction) => getRateLimiter(req, res, next),
|
(req: Request, res: Response, next: NextFunction) => getRateLimiter(req, res, next),
|
||||||
// specificRouteLimiter,
|
|
||||||
async (req: Request, res: Response) => {
|
async (req: Request, res: Response) => {
|
||||||
res.send("you're fine")
|
res.send("you're fine")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user