Skip to content

404 when serving statics files with an express.js app #7359

Locked Answered by amyegan
leodev9911 asked this question in Help
Discussion options

You must be logged in to vote

Hey @leodev9911. It looks like your project uses the deprecated builds and routes config. Node.js runtime will automatically be used for the runtime for JS files in the /api directory so you can remove the builds part. I also recommend switching routes to rewrites. That isn't likely to solve the whole problem, but should make it a bit easier to debug without the extra config getting in your way.

There's also a guide available that walks through using Express.js with Vercel. This is a good starter to use if you're not already familiar with adapting Express sites to a serverless environment.

The config doesn't look quite right to me, but I don't know the full setup of your repo. If you can …

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
3 replies
@leodev9911
Comment options

@amyegan
Comment options

@leodev9911
Comment options

Answer selected by amyegan
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
2 participants