How to Set up an Express.js Server in Node.js

Опубликовано: 10 Февраль 2021
на канале: Hey Node
12,956
149

See the written version of this tutorial for links to prerequisites and related tutorials: https://heynode.com/tutorial/how-set-...

In this tutorial, you’ll learn how to start a basic HTTP server in Node.js with a few lines of code. Express allows us to get to "Hello World" with a server quickly. We'll create a basic server with a single route, create a middleware to log requests that we receive, as well as start our server listening on for requests on our localhost. Creating middleware and route handlers are the foundation of any server created with Express and will help you understand how to get started creating your own servers.

By the end of this tutorial, you should be able to:

Learn what Express Server is in Node.js
Build a simple Node Express app
Create routes with Express in Node
Create logging middleware that runs on every request

Heynode.com: The best online Node.js courses and tutorials to help you solve hard problems fast.