Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

198
Views
How to fix Nodejs Express Backend, Vercel production deployment routes issue

I just deploy my Node Js Express backend server on vercel but i can't get all the router defined in the router.js file through index.js using app.use().

How do i fix that issue !?

my index.js file :

app.use("/Api", Routes);
app.get("/", (req, res) => {
res.send("<center> MPDAM Project Server is Running Fine .. ๐Ÿ‘ </center>");
});

my router.js file :

const UserController = require("../controllers/userController");

router.get("/Users", UserController.getAllUsers);
router.get("/SingleUser/:id", UserController.getSingleUser);
router.post("/NewUser", UserController.NewUser);
router.delete("/DeleteUser/:id", UserController.DeleteUser);
router.patch("/UpdateUser/:id", UserController.UpdateUser);
router.post("/UserLogIn", UserController.UserLogIn);

my vercel.json file :

{
  "version": 2,
  "builds": [
    {
      "src": "./index.js",
      "use": "@vercel/node"
    }
  ],
  "routes": [
    {
      "src": "/(.*)",
      "dest": "index.js"
    }
  ]
}
about 4 years ago ยท Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
ยฉ 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!