feat: rate-limiting

Signed-off-by: Erik Michelson <github@erik.michelson.eu>
This commit is contained in:
Erik Michelson 2024-12-11 17:39:45 +01:00
parent e8f4cbabec
commit beea1c71ce
No known key found for this signature in database
GPG key ID: DB99ADDDC5C0AF82
10 changed files with 70 additions and 6 deletions

View file

@ -26,6 +26,9 @@ module.exports = {
errorTooLong: function (res) {
responseError(res, 413, 'Payload Too Large', 'Shorten your note!')
},
errorTooManyRequests: function (res) {
responseError(res, 429, 'Too Many Requests', 'Try again later.')
},
errorInternalError: function (res) {
responseError(res, 500, 'Internal Error', 'wtf.')
},