The Coders Blog
The Coders Blog The blog is about ideas & thoughts learned, received & experienced about the coding, programming, problem-solving, software project management and anything undeniably interesting.

Simple http server for file sharing in same network.

Feb 06, 2019 · 1 min
Simple http server for file sharing in same network.

If you have multiple devices and constantly need to share files between the devices then its quite hassle to find thumb drive. Using simple http server you can excess/transfer your file to another device in no time with these simple command.

What you need?

  1. Node JS install on your machine.
  2. 3 Simple Command to start server
  3. Ready to go

Installing Node JS.

For windows user
You can install Node JS from the link here
For Mac user
Go to the link above and install the setup files here or View this tutorial
For Linux user
Open the terminal and run this command.
sudo apt update
sudo apt install npm
sudo npm -i -g n
sudo n stable

Installing http-server package from npm

Open terminal or command line tool and check if node is installed or not.
node -v will print version. current version is v9.11.2
npm -v will print current version is 6.7.0
Installing npm package from npm.
npm i -g http-server
You can use sudo if you are linux or Mac user

Serving the folder over http

Then navigate to the folder you want to share over your network using terminal/command line tool in that folder.

example: cd User/desktop/foldertoshare

Now run the following command in

npm http-server -p 5656


Now you can open the address in another device browser such as chrome/ firefox and your browser will show files contain in the folder. In my case files in foldertoshare in desktop.

comments powered by Disqus