-
Notifications
You must be signed in to change notification settings - Fork 13
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
Migrated JSON Files to MongoDB. Abstracted Server functionality into MVC (Model & Controllers) #104
Conversation
added table of contents
Test -> Main Merge, Version 4
change the heroku links out for the railway links
update site link to railway
…d mongo database, added dotenv, added error handler function for api testing in postman
…resources to mongodb.
…is needed to be created)..
…testing purposes only)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left some comments detailing some changes and some points of confusion. To fully migrate, I think you should also delete the "resources.js" file
@@ -6,7 +6,16 @@ Contributions are what make the open source community such an amazing place to l | |||
|
|||
<ins>Please make sure to follow our guidelines below before making any contributions.</ins> | |||
|
|||
|
|||
- [Contributing](#contributing) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did anything change here, or did this section just get formatted?
- [Contributing](#contributing) | |
- [Contributing](#contributing) | |
- [Understanding Coding-Resources-API branch structure](#understanding-coding-resources-api-branch-structure) | |
- [Permanent Branches](#permanent-branches) | |
- [Main](#main) | |
- [Test](#test) | |
- [Resources](#resources) | |
- [How often should I stage changes?](#how-often-should-i-stage-changes) | |
- [Where should I make my pull request to?](#where-should-i-make-my-pull-request-to) | |
- [Creating an Issue](#creating-an-issue) | |
- [How to make a PR](#how-to-make-a-pr) |
@@ -24,22 +35,9 @@ app.get('/api', (req, res) => { | |||
res.json(resources); | |||
}); | |||
|
|||
app.get('/api/:keyword', (req, res) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this route being deleted?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is now located in the resourceRoutes, Jesse had just updated the endpoint
Co-authored-by: Jacob Asper <[email protected]>
… pulls information from mongoDB but this has removed capability to use partial keywords in a search. added nodemon as a dev dependency for testing: npm run dev
…rns resources for javascript
…tive matches for keyword
These commits fix the get matches functions in js/main.js and handle resource searches through MongoDB.server.js
js/main.js
controllers/resourceController.js
views/index.ejs
Closing #105 |
Summary:
api/resources/getResources
to input form insideviews > index.ejs
in order for resource fetching functionality to work again.Dependencies
Server.js
server.js
.env
fileRoutes & Controllers
getResources
- Migrated original functionality for resource query results from Mongo Database.createResource
- Custom API Endpoint for easily adding new resources to Mongo Database. (A view will be needed to be created later on for this to be done in the UI. Currently only available through Postman).Routes
- Abstracted API Endpoints into the routes folder. Created a search params/api/resources/:keyword
for returning resource results.Model
name
- String & Required.url
- String & Required.description
- String & Requiredkeywords
- Creates an array from a string sentence. Example:["JavaScript", "Git"]
Config
.env
file inside the config folder for easier organization. Please include:MONGO_URI
andPORT
Middleware
Closing #94