Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

service listening on http://localhost:3000 with undefined Environment #316

Open
dustbro opened this issue Jan 7, 2022 · 9 comments
Open

Comments

@dustbro
Copy link

dustbro commented Jan 7, 2022

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?

@sureshbabu1995
Copy link
Collaborator

Hi @dustbro

if you're using Linux OS - export NODE_ENV=development and then run it.

@dustbro
Copy link
Author

dustbro commented Jan 7, 2022

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' }

@dustbro
Copy link
Author

dustbro commented Jan 10, 2022

I had to start nodemon server as root for the environment to change.

@dustbro
Copy link
Author

dustbro commented Jan 10, 2022

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?
swagger empty

@sureshbabu1995
Copy link
Collaborator

sureshbabu1995 commented Jan 10, 2022

Hi @dustbro

Please run npm run swagger to generate swagger

and restart the service with rs or manually and use reload the web page

@dustbro
Copy link
Author

dustbro commented Jan 14, 2022

I get the same result after restarting the service.

@sureshbabu1995
Copy link
Collaborator

Hi,

Can you show me the output of npm run swagger command

@dustbro
Copy link
Author

dustbro commented Jan 22, 2022

[email protected] 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 [email protected] to update!
npm notice

[email protected] swagger
node ./resources/views/swagger.config.js

Swagger-autogen: Success ✔

[email protected] swagger
node ./resources/views/swagger.config.js

Swagger-autogen: Success ✔

[email protected] swagger
node ./resources/views/swagger.config.js

Swagger-autogen: Success ✔

[email protected] swagger
node ./resources/views/swagger.config.js

Swagger-autogen: Success ✔

@sureshbabu1995
Copy link
Collaborator

sureshbabu1995 commented Jan 27, 2022

Hi @dustbro

Please ping me to my mail. ID is [email protected], We'll schedule a call to fix it in a single shot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants