The issue lies in how the router is being mounted in your app.js file. Specifically, the path for app.use("api/post", postRoutes) is missing a leading forward slash (/). This causes Express to treat the path as a relative path, which is why your router is not working as expected