Node Package Manager (npm) is a command-line tool used to install the packages for Node.js. We will use this tool to download and install our simple HTTP server. Follow the given steps to install the HTTP server:
- From your device, open Command Prompt or shell and enter this:
npm install http-server -g
- This will download and install http-server as a global tool. Now, let's test it.
- Use your Command Prompt or shell and change your folder to Android, like this:
- Run http-server from the Android folder by entering the following:
http-server -p 9999
- You will see a list of endpoint URLs. Choose an endpoint that is on the same subnet as your Wi-Fi, the same subnet as your device. Copy or write ...