Coder Social home page Coder Social logo

config file in production about cli HOT 5 CLOSED

sequelize avatar sequelize commented on May 20, 2024
config file in production

from cli.

Comments (5)

sdepold avatar sdepold commented on May 20, 2024 1

There was quite some related discussion here: #77

tldr is:

You can configure your configuration file to point an environment to a specific environment variable, which is supposed to contain a database URL:

{
  "production": {
    "use_env_variable": "DB_HOST"
  }
}

In that case the CLI will load the env var DB_HOST and throw it into the url module to parse it. Credentials can be passed as well.

from cli.

sdepold avatar sdepold commented on May 20, 2024

Would env vars be an options?

from cli.

marcoschicote avatar marcoschicote commented on May 20, 2024

Sure.

from cli.

marcoschicote avatar marcoschicote commented on May 20, 2024

Great. Thanks.

from cli.

benbonnet avatar benbonnet commented on May 20, 2024

hope I'm not bothering coming by here; as for now this is not obvious

You then need to have two files to handle the configuration ( default sequelize.json, then some config.js than can parse environments variables) ? Or maybe 3 ( a something.js that declares which environments variables can be parsed via use_env_variable — according to #77) ?

As he is asking initially, wouldn't that be possible to handle the conf directly in index.js database/models definition file, using process.env vars, without relying on multiple external files ? This approach would sound a bit more straightforward and easy to understand

from cli.

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.