Building a web application has become a simpler task with the addition of web frameworks. A web framework in Node.js is a module that offers structure to your application. Through this structure, you can easily build and customize the way your application feels without worrying about building certain features from scratch, such as serving individual files. By the end of this lesson, you’ll know where to begin with web frameworks and how the one used in this book, Express.js, can reduce the time it takes you to get your application running.
This lesson covers
- Setting up a Node.js application with Express.js
- Navigating a web framework
Consider this
Your static web app from unit 1 is a success. The cooking community wants you to add more functionality and serve more web pages. You realize that your application isn’t fully prepared to handle more routes, let alone handling errors or serving other types of assets. Could there be an easier way to start development with some structure already in place?
Luckily, you can install a web framework with your Node.js application. Express.js, the framework you use in this book, handles a lot of the tasks most applications need right out of the box, such as error handling and static-asset serving. The more familiar you get with this framework’s methods and keywords, the faster you can build your applications.