Skip to content
Discussion options

You must be logged in to vote

I'm not getting such an error, @Firjens
Consider checking which version of @types/express you have. Mine is 5.

But also, for you I'd recommend to put app.use(limiter) inside the beforeRouting hook in your config.
Otherwise, those rate limiting middlewares won't be executed before endpoint handlers.

Related article: https://ez.robintail.cz/v23.6.1/using-native-express-middlewares

app.use(cors()) is (most likely) not needed — Express Zod API has its own implementation for the routes you declare in routing when cors option is enabled in config.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Firjens
Comment options

Answer selected by RobinTail
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants