Challenge:
Build an app that reads, create, update, and deletes data.
- Plain JavaScript
- Node.js
- Express (JS framework)
- MongoDB (Database)
- Mongoose (JS framework)
- Cloud9 (Online IDE)
- Postman (testing APIs)
- Lists all the entries / home page (GET)
- Let the user create blog posts and upload images (CREATE)
- Show each item individually and show you all the info (GET:item:id)(RED)
- Let the users edit the posts and use html for such the code is sanitized so no scripts on the input (/:id/edit)
- Update the content and redirects (UPDATE)
- Delete content permanently (DESTROY)
In this exercise i used:
The purpose of this exercise was to be able to map HTTP routes and CRUD (create, read, update, and destroy) using the seven Restful Routes pattern.
This exercise as basic as it might seem enfolds very powerful concepts, and I’m surely looking foward to advance for the next level with a more complex app using this technologies.
Result:
See the source code