Chapter 3. Building a Node Web Server
This chapter covers the following:
-
Using Node as a web interface
-
Building a Node web app with Fastify
-
Serving static pages with dynamic content
Node is about using JavaScript on the server. JavaScript itself is already an asynchronous language by nature, but not until 2009 was it used outside your standard web browser. As dependence on the internet grew worldwide, businesses demanded new innovative development strategies that also took into account hirable skill sets already in the market. Thereafter, JavaScript took off for frontend and backend development, setting up new application design patterns with Node’s single-threaded event loop.
In this chapter, you’ll explore the most common use case for Node, a web application, and how the event loop plays a role. By the end of this chapter, you’ll be able to use Node’s most popular project framework, Fastify, to build both simple web servers and more extensive applications.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access