Refresh an article about static HTTP server in Node.JS

This commit is contained in:
Dorian Niemiec 2024-03-19 18:24:49 +01:00
parent 68d1a96f3a
commit 1b93af9077
2 changed files with 4 additions and 2 deletions

View file

@ -7,12 +7,14 @@ tags:
- javascript - javascript
- server - server
categories: Tips categories: Tips
thumbnail: /images/covers/How-to-create-static-HTTP-server-in-Node-JS.png
--- ---
Node.JS is a event driven server-side JavaScript runtime, that uses V8 JS Engine (same as Chromium) and executes code outside a web browser. If you want to serve static files on your Node.JS web application, you can create a simple static HTTP server in Node.JS.
Node.JS is a event-driven server-side JavaScript runtime, that uses V8 JS engine (same as Chromium) and executes code outside a web browser.
In this article we will cover basics of implementation of HTTP server in Node.JS and build a simple static HTTP server. In this article we will cover basics of implementation of HTTP server in Node.JS and build a simple static HTTP server.
## Prerequisites ## Prerequisites
- Node.JS installed on your developement machine - Node.JS installed on your development machine
## Built-in HTTP module ## Built-in HTTP module
Node.JS has built-in `http` module, which allows Node.JS to communicate over HyperText Transfer Protocol (HTTP). Node.JS has built-in `http` module, which allows Node.JS to communicate over HyperText Transfer Protocol (HTTP).
To include that module, we use `require()` method: To include that module, we use `require()` method:

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 KiB