Setting up a Server with HTTP
Learn how to set up an HTTP server with Node.js.
StartKey Concepts
Review core concepts you need to learn to master this subject
What is HTTP?
HTTP Transmission
Securing HTTP
The .createServer()
Method
The Request Object
The Response Object
Anatomy of a URL
The url
Module
What is HTTP?
What is HTTP?
Hypertext Transfer Protocol (HTTP) is a data exchange protocol used to transmit/receive information on the Web. This protocol is widely used and serves as the backbone for communication between applications and servers.
Setting up a Server with HTTP
Lesson 1 of 1
- 1Today is like any other normal day—you visit your favorite website to check out some new content or accomplish a task. The information appears on your page instantly, as if by magic. But have…
- 2HTTP requests and responses have specific structures to help facilitate the exchange of information between a client and a server. These structures encapsulate all of the important information requ…
- 3HTTP requests/responses contain all of the information needed to communicate with other entities on the web efficiently, but how do these messages actually make it to their destinations? Just as a …
- 4To process HTTP requests in JavaScript and Node.js, we can use the built-in http module. This core module is key in leveraging Node.js networking …
- 5HTTP servers have to break down requests into their constituent parts to effectively process them and provide adequate responses. In that same vein, designing an [API](https://en.wikipedia.org/wiki…
- 6Typically, an HTTP server will require information from the request URL to accurately process a request. This request URL is located on the url property contained within the req object itself. To p…
- 7While the url module can handle query strings attached to URLs, it can also be done with the built-in querystring module. T…
- 9Once a request is processed, a response must be returned to the client to inform it of what happened. To build a response for the client, several pieces of information are required. One of these pi…
- 10While we have encountered simple examples of servers handling HTTP requests, some requests require a bit more work than returning a simple string such as ‘Hello World’. In real-world applications, …
- 11Just like with databases, sometimes servers need to make requests to external APIs to accomplish some goal. There are a variety of reasons to reach out to external services. Some common situations …
What you'll create
Portfolio projects that showcase your new skills
How you'll master it
Stress-test your knowledge with quizzes that help commit syntax to memory