How to create a simple NodeJS server on Windows

NodeJS is useful for creating a local host server. It is also easy to set it up on Mac. But for Windows users, there aren’t any websites showing how to create a NodeJS server.

The first step is to install the NodeJS app. You can install it by clicking this button.

After installing, create a folder that you will use to create the server.
Open Command Prompt and direct it to the new folder that you created.
Run this command

npm install -g http-server

After that, run using

http-server

It will show the IP to connect to that server. Connect to the IP and you’re all set. You can add HTML files or any files if you just want files to be downloaded on other devices.