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

Basic coding convention - db initialization #16

Open
mirmahathir1 opened this issue May 24, 2022 · 0 comments
Open

Basic coding convention - db initialization #16

mirmahathir1 opened this issue May 24, 2022 · 0 comments
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@mirmahathir1
Copy link
Member

Currently you have initialized all db connections in the index file like the following:

initializeApp({
credential: cert({
type: process.env.TYPE,
project_id: process.env.PROJECT_ID,
private_key_id: process.env.PRIVATE_KEY_ID,
private_key: process.env.PRIVATE_KEY,
client_email: process.env.CLIENT_EMAIL,
client_id: process.env.CLIENT_ID,
auth_uri: process.env.AUTH_URI,
token_uri: process.env.TOKEN_URI,
auth_provider_x509_cert_url: process.env.AUTH_PROVIDER,
client_x509_cert_url: process.env.CLIENT_CERT_URL,
}),
});

Initialize your db connections in a seperate folder like the following:
https://github.com/Badhan-BUET-Zone/badhan-backend/blob/3983fe2d84a362ba3b63731967495cf485fd6d23/src/app.js#L15
https://github.com/Badhan-BUET-Zone/badhan-backend/blob/master/src/db/mongoose.js

@mirmahathir1 mirmahathir1 added the documentation Improvements or additions to documentation label May 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants