Express is a full web framework and also a web server. We'll build a very, very simple site for computer repair and we'll focus on routing, parsing data using the Pug template engine, and also using a module called Nodemailer, which gives us a contact form:
So this is the Home
page, and then we have an About
page and also a Contact
form that works using Nodemailer:
It is a very simple application but it's a nice introductory to Express, which we'll be using throughout the book. So lets get started!
In this project we're going to be building a website using the Express framework. Express is a Node.js module that gives us a full framework, it gives us a routing system and an HTTP server.
To install it, it's really simple we just need to say npm install express
although we're going to add the -g
flag because we want to install it globally so that we can access it from anywhere. From the frontend this website is going to be very, very simple, it'll just have...