'Express.js API Route not found on production

I'm getting a 404 not found on my express.js API on every route but only when trying to access it from Vercel, Netlify, etc.

Here is my code https://github.com/JustLaunched/api



Solution 1:[1]

If you're not trying to use vercel strictly

There is no where near enough information here :( Where are you hosting? Are you hitting the domain/ip correctly at all? Are the ports exposed correctly? Is your front-end app sending requests to the correct url?

If you're trying to use vercel strictly

I think it may be worth checking out this page on this type of issue/setup .

While possible, yes, and vercel provides instructions to use express over the base level nextjs api, it doesn't come without caveats.

Based on the code in your repo as well, it seems that you're trying to host a server side application. Vercel is strictly for frontends, and doesn't host server side apps like an express server or other backend frameworks/languages in general.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1