Dynamic config for API route
Answered
Ashy Storm-Petrel posted this in #help-forum
Ashy Storm-PetrelOP
Hi everyone, I want to config the max size for the request payload via an env variable in .env file (Access at runtime, not build time). I know this does not work, but have anyone had a way to work around? Thank you so much.
6 Replies
@Ashy Storm-Petrel Hi everyone, I want to config the max size for the request payload via an env variable in .env file (Access at runtime, not build time). I know this does not work, but have anyone had a way to work around? Thank you so much.
why not just limit the payload size programmatically in route handlers?
@ᴉuɐpɹɐɐ why not just limit the payload size programmatically in route handlers?
Ashy Storm-PetrelOP
Do you think that will make the Vercel cost higher compared to leveraging the Vercel config?
@Ashy Storm-Petrel Do you think that will make the Vercel cost higher compared to leveraging the Vercel config?
vercel already has a payload hard limit of 4.5mb
Answer
@ᴉuɐpɹɐɐ vercel already has a payload hard limit of 4.5mb
Ashy Storm-PetrelOP
Thank you very much, do you have a link for that?
Ashy Storm-PetrelOP
Thank you