mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-02-04 22:51:13 +00:00
Fix type for rate limiter middleware in router
Casts the rate limiter middleware to RequestHandler to resolve type compatibility issues with Express router middleware.
This commit is contained in:
parent
1fa0980709
commit
9a31276ef6
@ -1,4 +1,4 @@
|
||||
import { Router } from 'express';
|
||||
import { Router, RequestHandler } from 'express';
|
||||
import rateLimit from 'express-rate-limit';
|
||||
import {
|
||||
ListFilesHandler,
|
||||
@ -28,7 +28,7 @@ const apiLimiter = rateLimit({
|
||||
},
|
||||
});
|
||||
|
||||
router.use(apiLimiter);
|
||||
router.use(apiLimiter as unknown as RequestHandler);
|
||||
|
||||
router.get('/list', ListFilesHandler);
|
||||
router.post('/mkdir', CreateDirHandler);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user