I want to connect the databases which are for the different servers (like dev, staging, live, production). There are different databases and credential for all the server. When a server will be called it will access data only that particular database. In my code, I am using node js with sequelize for the database connection to build the API in GraphQL.How can I do this? I have already tried a lot. Please suggest to me. If need code I can post it here.
相关问题
- npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fs
- google-drive can't get push notifications
- How to reimport module with ES6 import
- Why is `node.js` dying when called from inside pyt
- How to verify laravel passport api token in node /
相关文章
- node连接远程oracle报错
- How can make folder with Firebase Cloud Functions
- @angular-cli install fails with deprecated request
- node.js modify file data stream?
- How to resolve hostname to an ip address in node j
- Transactionally writing files in Node.js
- Log to node console or debug during webpack build
- Get file created date in node
The best way to do this is to keep a seperate .env file on each server. and load the credentials form .env file itself by using dotenv module.
you can load credenials by
process.env.CREDENTIALS_KEY
Example
Load in your js/ts file like: