Skip to content

Latest commit

 

History

History
83 lines (55 loc) · 1.65 KB

File metadata and controls

83 lines (55 loc) · 1.65 KB

URGENT: Deploy Updated Backend to Render

Problem

Your deployed backend at https://api.nirveonx.com is using old code that redirects instead of returning JSON. The app will fail.

Solution - Deploy Fixed Backend

Option 1: Push to Git (Fastest if Connected)

cd /Users/sairithwikbejadi/Desktop/NirveonX/N-Backend

# Add the fixed authRouter.js
git add router/authRouter.js
git add app.js

# Commit
git commit -m "Fix auth to return JSON instead of redirects"

# Push to trigger Render deployment
git push origin main

Render will auto-deploy in 2-3 minutes.


Option 2: Manual Deploy on Render

  1. Go to https://dashboard.render.com
  2. Find "N-Backend" service
  3. Click Manual DeployDeploy latest commit
  4. Wait 2-3 minutes for deployment

What Was Fixed

Your local N-Backend/router/authRouter.js has the correct JSON auth:

router.post("/login", (req, res, next) => {
  passport.authenticate("local", (err, user, info) => {
    if (!user) {
      return res
        .status(401)
        .json({ message: info?.message || "Invalid credentials" });
    }
    // ... returns JSON
  })(req, res, next);
});

But deployed backend still has old redirect code.


Verify Deployment

After deploying, test:

curl -X POST https://api.nirveonx.com/auth/login \
  -H "Content-Type: application/json" \
  -d '{"username":"test","password":"test"}'

Should return JSON like:

{ "message": "Invalid credentials" }

NOT a redirect!


For Chatbot (Optional)

The MCP servers (chatbot) also need to be deployed if you want chat to work in production APK.

For now, auth is the priority!