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

Support .env files in web frameworks #5501

Merged
merged 5 commits into from
Feb 10, 2023

Conversation

jamesdaniels
Copy link
Member

@jamesdaniels jamesdaniels commented Feb 9, 2023

Fixes #5247

Copy link
Member

@leoortizz leoortizz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I deployed a Next.js app and the variables from .env were available in my APIs.

Do we also need to handle .envs based on NODE_ENV? Like .env.development .env.production .env.test?

@jamesdaniels
Copy link
Member Author

Do we also need to handle .envs based on NODE_ENV? Like .env.development .env.production .env.test?

The glob copy should move anything that starts with .env. into the code-generated functions directory, so should work out of box ;)

@jamesdaniels jamesdaniels enabled auto-merge (squash) February 10, 2023 16:51
@leoortizz
Copy link
Member

Do we also need to handle .envs based on NODE_ENV? Like .env.development .env.production .env.test?

The glob copy should move anything that starts with .env. into the code-generated functions directory, so should work out of box ;)

I see. Was thinking about not deploying .env.test/.env.development to production

@codecov-commenter
Copy link

codecov-commenter commented Feb 10, 2023

Codecov Report

Base: 56.19% // Head: 56.17% // Decreases project coverage by -0.02% ⚠️

Coverage data is based on head (883ff9c) compared to base (17de2ab).
Patch coverage: 16.66% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5501      +/-   ##
==========================================
- Coverage   56.19%   56.17%   -0.02%     
==========================================
  Files         317      317              
  Lines       21461    21470       +9     
  Branches     4381     4383       +2     
==========================================
+ Hits        12059    12060       +1     
- Misses       8342     8350       +8     
  Partials     1060     1060              
Impacted Files Coverage Δ
src/frameworks/index.ts 15.05% <16.66%> (-0.14%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

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

Successfully merging this pull request may close these issues.

NextJS environment variables inaccessible in server-side code when deployed with Web Frameworks
3 participants