404 on the other routes I created in my Node.js express app

I followed the documentation about deploying express on vercel and was able to deploy the app successfully. However, when I added some other routes, I cannot access it.

This is my current folder structure.

The “/” route inside the index.js is fine. The problem occurs when I use express Routers.
I’ve created a route in index.js (“/api”) to look up to main.route.js that looks up to the controllers.


I am getting a 404 Not Found when accessing the supposed route (“/api/auth/register”). Is there something I need to add on my vercel.json? I only added what I saw on one of the answers here:

{ "version": 2, "rewrites": [{ "source": "/(.*)", "destination": "/api" }] }

or is there anything else I am missing?

There’s another community post with 404 debugging tips that might be helpful. Please give these solutions a try and let us know how it goes.

A human should be around soon to offer more advice. But you can also get helpful information quickly by asking v0.

If you’re having trouble deploying an Express app, this guide can help.

You can also ask v0 for suggestions tailored to your own project setup.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.