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

Validate env file #14

Open
pablo-clueless opened this issue Sep 15, 2023 · 7 comments
Open

Validate env file #14

pablo-clueless opened this issue Sep 15, 2023 · 7 comments

Comments

@pablo-clueless
Copy link
Member

  • Create a function that validates all environment variables when the app starts.
  • The function should only allow the app to start if all environment variables are verified to be present and of the required type
  • An error should be thrown instead of the app crashing if a variable isn't present.
pablo-clueless added a commit that referenced this issue Nov 5, 2023
@The-CodeINN
Copy link

The-CodeINN commented Jul 13, 2024

Is this resolved? If not, I'd like to work on this @pablo-clueless

@sparrowsl
Copy link
Member

@The-CodeINN any updates on this??
still working on it..??

@The-CodeINN
Copy link

The-CodeINN commented Jul 17, 2024

Yes, but I was unable to start the application. Here is my approach:

  1. Create an env file with the following content:
APP_VERSION=v1
NODE_ENV=development
PORT=5000
JWT_SECRET=pfkkskwdlqoeka
  1. Run pnpm predev
  2. Run pnpm dev
  3. No response when I tried to access it on localhost:5000

Also i have a lot of generated files, adding to my changes:

image

@sparrowsl
Copy link
Member

I think the generated files are from vitepress.

I'll give it a try and share my findings...

@sparrowsl
Copy link
Member

@The-CodeINN I checked, and based on your steps, it needs to have a database URI before it can even run.
I opened an issue that is probably related and would add it in the config file

@The-CodeINN
Copy link

The-CodeINN commented Jul 23, 2024

Okay.. i think it's better we have a .env.example for reference

@pablo-clueless
Copy link
Member Author

I'll add an env.example later today

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

3 participants