using an enviroment variable for local sequelize configuration

前端 未结 4 1052
感情败类
感情败类 2021-02-04 07:25

I\'m looking to use an environment variable inside of the config.json file of my project using sequelize. I\'m using dotenv to set environment variables locally. My config.json

4条回答
  •  悲&欢浪女
    2021-02-04 08:01

    you can use the use_env_variable for development too. you already seem to be using dotenv, so im assuming you have a .env file already setup. just add this line to it:

    LOCALDB=mysql://[user]:[pass]@[sqldomain]/[db name]

    replace the stuff in [] as necessary, and in your config file set "use_env_variable" to LOCALDB, just like how you have JAWSDB for production.

提交回复
热议问题