It looks like either your server.js is not deployed to your prod environment correctly, or the router for the events endpoints is not registered correctly. You can try to temporarily add the routes for events and tasks to a single router object in e.g. events-and-tasks.js, prefixing endpoints accordingly (you can also change the base path temporarily to e.g. api2 so you can make sure that the update got deployed successfully):
events-and-tasks.js:
const express = require("express")
// ...
const router = express.Router()
router.get("/events", async (req, res) => {
// ...
})
router.get("/tasks", async (req, res) => {
// ...
})
module.exports = router
server.js
const routes = require("./routes/events-and-tasks");
app.use("/api2", routes);
If /api2/events and /api2/tasks both work, there is something going on with how the two separate routers are added. I would check a few more things in this case:
tasks router first and the events router second, does that fix the events endpoint and break the tasks endpoint?