Modulus.io NodeJS deployment

425 Views Asked by At

I'm trying to deploy my app to Modulus. I have set the environment variables:

  • NODE_ENV = production
  • MODULUSURL = mongodb://user:[email protected]:27017/Ub7ehyqa
  • PORT = 8080

When I deploy the app I'm receiving the following error:

/mnt/data/1/server/api/user/index.js:10 router.get('/', controller.index); ^ TypeError: Cannot call method 'get' of undefined at Object. (/mnt/data/1/server/api/user/index.js:10:8) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Module.require (module.js:364:17) at require (module.js:380:17) at module.exports (/mnt/data/1/server/routes.js:12:25) at Object. (/mnt/data/1/server/app.js:24:20) at Module._compile (module.js:456:26)

It appears the MongoDB connection is established, so I've ruled that out as the issue. Also, this is not occurring in my local/dev environment. Is there a chance, when deploying to a production server (like Mondulus) I would need to update the paths to such components like express?

1

There are 1 best solutions below

0
On

There should be a MONGO_URL not MODULUSURL and obviously don't post publicly, but make sure your fill in the username and password in the MONGO_URL.