concept this lesson in category node

appears as: this lesson, This lesson
Get Programming with Node.js

This is an excerpt from Manning's book Get Programming with Node.js.

In this lesson, my objective was to teach you about the book’s structure, what Node.js is, and why it’s important. I also talked about how you should approach this book. If you treat this book as a course with subtopics and lectures, you’ll build your knowledge and skills incrementally until you become a competent web developer. In the next lesson, you install the tools that you need to get coding.

In lesson 5, you directed URL traffic with a routing system that matched request URLs to custom responses. In this lesson, you learn how to serve whole HTML files and assets such as client-side JavaScript, CSS, and images. Say goodbye to plain-text responses. At the end of the lesson, you improve your route code and place your logic in its own module for cleaner organization.

This lesson covers

In this lesson, you learned how to serve individual files. First, you added the fs module to your application to look for HTML files in your views folder. Then you extended that functionality to application assets. You also learned how to apply your routing system to its own module and selectively register routes from your main application file. In unit 2, I talk about how you can use the application structure provided by Express.js, a Node.js web framework.