As part of my 30 days of Node I’m building a ExpressJS app that allows you to create, edit and save contacts. I’ve been working on this app for a couple of days, not really got too far just managed to get the the package.json file and an Readme file setup. In the package file I’ve got the Express framework and Nodemon all setup, along with the very basic app.js file setup.
I know there is the Express Generator tool which would set up the core of an app, but as this is a project for learning Express I think it’s better to start adding the bits of the project, bit by bit. Instead of letting a tool setup a project with all these parts (views, routes and the core app.js file) and then wondering how it all works. I think it’s better to setup parts of the app as I go and learn how to implement them. I think tools like Express Generator are fantastic they can help you get a new Express site setup and running in minutes, they really have their place.
I mentioned earlier that I’m using Nodemon with this project, the reason for this is because the main drawback I see using Express is that you have to keep restarting the server after each change in order to be able to see the change. It can be annoying and I know that there is probably a NPM package I can install that gives me live reload (which is awesome and something that I wish I had back when I started building websites in the late 90s). So for now I’ll use Nodemon to monitor my app for changes and then I can manually refresh the site to see the changes. This isn’t perfect, but better than having to restart the server after each change.
Anyway my project is on GitHub, as this is what all the cool kids do nowadays. My next task is to start looking into how to create views and routes. How routes work and how they can load a view.