Giter Club home page Giter Club logo

Comments (4)

AkhilJ321 avatar AkhilJ321 commented on August 19, 2024 1

@KhudaDad414. So here we are looking for a functionality , where we have multiple envs like .env.production .env.development and then according to NODE_ENV specific env is used.SO we can acheive this thing by require('dotenv').config({ path: `.env.${process.env.NODE_ENV}` });.

from glee.

KhudaDad414 avatar KhudaDad414 commented on August 19, 2024 1

@AkhilJ321, I suggest you follow the following steps:

  1. Install @next/env.

  2. Use the loadEnvConfig function to load the configuration in the index.ts file of Glee. It should be something like loadEnvConfig(GLEE_PROJECT_DIR, isDev). You can check if it is a development environment by verifying whether process.env.NODE_ENV is set to development or production.

  3. Document how Glee can now support multiple .env files. You can draw inspiration from Next.js environment variables documentation since Glee will use Next.js's package, and the functionality will be the same.

  4. For testing, run one of the examples and then create files like .env, .env.local, .env.production, .env.development, adding environment variables to them. Afterwards, log these variables in the example's function to see if it picks up the variables as expected.

from glee.

AkhilJ321 avatar AkhilJ321 commented on August 19, 2024

@KhudaDad414 ,I made the changes in code, but i am confused about how to test this thing out in my local setup.

from glee.

asyncapi-bot avatar asyncapi-bot commented on August 19, 2024

🎉 This issue has been resolved in version 0.35.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

from glee.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.