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

Install dotenv package and replace the explictly mentioned database host path with process.env.MONGODB_URI #2

Open
tusharkhatriofficial opened this issue Sep 25, 2022 · 4 comments
Assignees
Labels

Comments

@tusharkhatriofficial
Copy link
Owner

  • Install dotenv package using npm i dotenv
  • Create a new file .env and add MONGODB_URI=mongodb://localhost:27017/blogDB or your local/remote equivalent
  • Replace mongoose.connect("mongodb://localhost:27017/blogDB", {useNewUrlParser: true, useUnifiedTopology: true}); with mongoose.connect(process.env.MONGODB_URI, {useNewUrlParser: true, useUnifiedTopology: true}); in app.js
  • Do not forget to add .env to .gitignore file.
@Ujjawal3
Copy link
Contributor

Hey! @tusharkhatriofficial can you assign me this task as a part of hacktoberfest

@tusharkhatriofficial
Copy link
Owner Author

Hi @Ujjawal3 yes I will!

Please hold your pull request until the event starts... the main idea of this is to add the dotenv package in the package.json and replace the explicitly mentioned MongoDB URI in the app.js file. I will also come up with a few more issues before the event starts, you can check them out as well.

@Ujjawal3
Copy link
Contributor

Ujjawal3 commented Oct 1, 2022

Hi @tusharkhatriofficial as hacktoberfest has started today so can I start working on this now ?

@tusharkhatriofficial
Copy link
Owner Author

Thank You for working on this :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants