Weekly Project 2: MongoDB, Express and Node Blog App08 Aug 2016
Something a little more ambitious this week, still pretty easy though. A simple blog app with MongoDB, Express, and Node. This was fairly similar to the first few steps of the microblog app for the Flask framework. I kept it even simpler. My primary goal was to familiarize myself with the Express framework and RESTful routes.
About the app
A blog app is a fairly standard tutorial for many frameworks. In the past I’ve tried to follow the microblog tutorial for flask. I didn’t get very far, and never completed it. For this app I followed instructions from the Udemy course The Web Developer Bootcamp. I highly recommend the course, I’ve been working through it for a month and have found it very straight forward, and the instructor is great. It is really good for beginners with no experience in web development.
For the user interface I used the Semantic UI framework. In the future I may do some more work on this project. I can flush out the homepage a little more, and work on the blog entry portion a little. I would like to set up a similar application with a Postgres database in the future.
Nuggets & Pearls
A few of the biggest takeaways from this weeks project.
mongod --dbpath ~/data/dbto start the MongoDB client, be sure Mongo is running before trying to run the app
- RESTful routes are the standard
- I don’t really like Semantic UI’s documentation, it isn’t as easy as Bootstrap
node app.jsto serve your app
- Callbacks are a completely foreign concept to me, I must look into it more.
- HTTP only supports GET and POST request, method override resolves this
As always the code can be found on GitHub