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

feat: configure MongoDB with mevn generate #178

Merged
merged 9 commits into from Jul 7, 2020

Conversation

danivijay
Copy link
Contributor

@danivijay danivijay commented Jul 5, 2020

What kind of change does this PR introduce?

A feature

Did you add tests for your changes?
No

If relevant, did you update the documentation?
No

Summary

Contributes to #176 . ie, adding MongoDB configuration in server.

Does this PR introduce a breaking change?

No

Other information
This is not a working draft you'll get a basic idea on my thought process. I'm very new to this type of application, and there are some grey areas. Please contact in person if possible so that I can clear my doubts @jamesgeorge007

@welcome
Copy link

welcome bot commented Jul 5, 2020

Thanks for opening this pull request! Please check out our contributing guidelines.

Copy link
Member

@jamesgeorge007 jamesgeorge007 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good already 👍
Left a couple of suggestions.

src/commands/basic/generate.js Outdated Show resolved Hide resolved
src/helpers/db/mongodb.js Outdated Show resolved Hide resolved
src/helpers/db/mongodb.js Outdated Show resolved Hide resolved
@jamesgeorge007
Copy link
Member

jamesgeorge007 commented Jul 6, 2020

Also, we no longer require this anymore:-

// const mongoose = require("mongoose");

/* Uncomment these lines once you have the CRUD template
mongoose.connect(process.env.DB_URL).catch((err) => {
console.error("eror: " + err.stack);
process.exit(1);
});
mongoose.connection.on("open", () => {
console.log("connected to database");
});
mongoose.Promise = global.Promise;
*/

@danivijay
Copy link
Contributor Author

@jamesgeorge007 all the review comments are addressed and PR is updated. Please re-review.

@danivijay danivijay marked this pull request as ready for review July 7, 2020 14:35
@jamesgeorge007 jamesgeorge007 added this to In progress in Roadmap via automation Jul 7, 2020
@jamesgeorge007 jamesgeorge007 added the enhancement Enhancement to an existing feature label Jul 7, 2020
@jamesgeorge007 jamesgeorge007 linked an issue Jul 7, 2020 that may be closed by this pull request
@danivijay
Copy link
Contributor Author

@jamesgeorge007 added missed file rewrite too. Please verify

@jamesgeorge007 jamesgeorge007 added this to the v1.8.0 milestone Jul 7, 2020
@jamesgeorge007 jamesgeorge007 changed the title feat: add mongodb connection feat: setup MongoDB with mevn generate Jul 7, 2020
Copy link
Member

@jamesgeorge007 jamesgeorge007 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

@jamesgeorge007 jamesgeorge007 merged commit 347fca0 into madlabsinc:develop Jul 7, 2020
Roadmap automation moved this from In progress to Done Jul 7, 2020
@welcome
Copy link

welcome bot commented Jul 7, 2020

congrats
Congrats on your very first contribution 👏 Looking forward to having more from your side

@jamesgeorge007 jamesgeorge007 changed the title feat: setup MongoDB with mevn generate feat: configure MongoDB with mevn generate Jul 7, 2020
jamesgeorge007 added a commit that referenced this pull request Aug 13, 2020
* feat: add mongodb connection

* feat(db): change export to commonjs

Co-authored-by: James George <jamesgeorge998001@gmail.com>

* feat(db): add additional params in mongoose connect

Co-authored-by: James George <jamesgeorge998001@gmail.com>

* feat(db): review changes on generate, rearrange helpers

* feat: remove unwanted commented code for mongodb conn

* fix: write server file back after adding db conn

Co-authored-by: James George <jamesgeorge998001@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement to an existing feature
Projects
Roadmap
  
Done
Development

Successfully merging this pull request may close these issues.

Set up MongoDB configurations automatically with mevn generate
2 participants