toHttpResponse
Αυτό το περιεχόμενο δεν είναι ακόμη διαθέσιμο στη γλώσσα σου.
toHttpResponse(
error):HttpResponse
Defined in: packages/pipeline-rate-limit/src/http.ts:25
The HTTP answer for a RateLimitExceededError: 429 Too Many Requests with a
Retry-After header. Framework filters and Express handlers reply with it.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Example
Section titled “Example”app.use((error, _req, res, next) => { if (!(error instanceof RateLimitExceededError)) return next(error); const { status, body, headers } = toHttpResponse(error); res.status(status).set(headers).json(body);});