mirror of
https://github.com/koreanbots/core.git
synced 2025-12-16 22:30:23 +00:00
feat: added custom 429 status handler
This commit is contained in:
parent
6cdb920478
commit
761009ab9e
9
pages/api/_custom/429.ts
Normal file
9
pages/api/_custom/429.ts
Normal file
@ -0,0 +1,9 @@
|
||||
import ResponseWrapper from '@utils/ResponseWrapper'
|
||||
import { NextApiHandler, NextApiRequest, NextApiResponse } from 'next'
|
||||
|
||||
const RateLimit: NextApiHandler = (_req: NextApiRequest, res: NextApiResponse) => {
|
||||
res.statusCode = 429
|
||||
return ResponseWrapper(res, { code: 429, message: '지정된 시간에 너무 많은 요청을 보냈습니다. 잠시 뒤에 시도해주세요.' })
|
||||
}
|
||||
|
||||
export default RateLimit
|
||||
Loading…
x
Reference in New Issue
Block a user