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?
- Node JS install on your machine.
- 3 Simple Command to start server
- Ready to go
Installing Node JS.
For windows user: You can install Node JS from the link here.
For Mac user: Visit to the link 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 192.168.100.15:5656
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.
Originally published at https://thecodersblog.com/file%20server/2019/02/06/share-file-using-simple-http-server.html on February 6, 2019.