service listening on http://localhost:3000 with undefined Environment
dustbro opened this issue · comments
I just followed the install videos (which where very helpful!) but run into issues when installing on Ubuntu 20.04.
I hit an error when running nodemon user.server.js about NODE_ENV in /socioboard-api/Common/Sequelize-cli/models/index.js
I used export NODE_ENV=development whenever needed throughout the install, but NODE_ENV was set to production.
const env = process.env.NODE_ENV || 'production';
I changed this value to development and the server started, but with an "undefined Environment" error.
service listening on http://localhost:3000 with undefined Environment!
Navigating to the webpage localhost:3000 triggers a response from the server:
GET /explorer/ 304 1.736 ms - - GET /explorer/ 200 0.256 ms - -
but the webpage is blank... probably because the environment is wrong.
Where should I look to correct this issue?
Hi @dustbro
if you're using Linux OS - export NODE_ENV=development and then run it.
export NODE_ENV=development
Thanks for the reply! I'm using this already before I run it, but still get undefined Environment.
And I don't see anything helpful in the user log.
Where else can I check the environment variable?
user07-01-2022.log { message: 'Cron started for updating all linkedIn account access token', level: 'info', timestamp: '2022-01-07T19:52:59.367Z' } { message: 'Mongo Database has been connected.', level: 'info', timestamp: '2022-01-07T19:52:59.827Z' } { message: 'service listening on http://localhost:3000 with undefined Environment!', level: 'info', timestamp: '2022-01-07T19:52:59.830Z' }
I had to start nodemon server as root for the environment to change.
I'm able to get the proper environment running
service listening on http://localhost:3000 with development Environment!
but the Swagger webpage is empty. Do I need to change localhost in socioboard config to IP address instead?
the server response is:
GET /explorer/ 200 0.229 ms - -
Which I think is normal?
Hi @dustbro
Please run npm run swagger
to generate swagger
and restart the service with rs
or manually and use reload the web page
I get the same result after restarting the service.
Hi,
Can you show me the output of npm run swagger
command
suresh-babu-g@1.0.0 swagger
node ./resources/views/swagger.config.js
Swagger-autogen: Success ✔
npm notice
npm notice New patch version of npm available! 8.3.0 -> 8.3.2
npm notice Changelog: https://github.com/npm/cli/releases/tag/v8.3.2
npm notice Run npm install -g npm@8.3.2 to update!
npm notice
suresh-babu-g@1.0.0 swagger
node ./resources/views/swagger.config.js
Swagger-autogen: Success ✔
suresh-babu-g@1.0.0 swagger
node ./resources/views/swagger.config.js
Swagger-autogen: Success ✔
notification@5.0.0 swagger
node ./resources/views/swagger.config.js
Swagger-autogen: Success ✔
suresh-babu-g@1.0.0 swagger
node ./resources/views/swagger.config.js
Swagger-autogen: Success ✔
Hi @dustbro
Please ping me to my mail. ID is sureshbabu@socioboard.com
, We'll schedule a call to fix it in a single shot.