https://github.com/nlfmt/local-file-server
Quickly serve files from a directory to all computers on your local network. Navigate that directory with an easy-to-use web interface, click any file to download.
https://github.com/nlfmt/local-file-server
cross-platform expressjs filesystem javascript server sharing
Last synced: 10 months ago
JSON representation
Quickly serve files from a directory to all computers on your local network. Navigate that directory with an easy-to-use web interface, click any file to download.
- Host: GitHub
- URL: https://github.com/nlfmt/local-file-server
- Owner: nlfmt
- License: mit
- Created: 2022-06-06T01:55:30.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-06-14T18:03:46.000Z (over 3 years ago)
- Last Synced: 2025-04-12T12:57:55.834Z (10 months ago)
- Topics: cross-platform, expressjs, filesystem, javascript, server, sharing
- Language: HTML
- Homepage:
- Size: 56.6 KB
- Stars: 5
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Local File Server
Quickly serve files from a directory to all computers on your local network.\
Navigate that directory with an easy-to-use web interface, click any file to download.

## Installation *(with binaries)*
1. Download the binaries from the [releases page](https://github.com/nlfmt/local-file-server/releases).
2. Extract the binaries into any directory.
3. For Linux & Mac OS X you need to turn the binary into an executable.
```sh
chmod +x serve
```
4. Add the right binary to your `PATH` environment variable.\
On Linux, you can also use `ln -s /path/to/serve /usr/local/bin/serve`
## Installation *(with nodejs & start script)*
1. Clone this repository to your computer.
```sh
git clone https://github.com/nlfmt/local-file-server.git
```
2. Install the dependencies.
```sh
cd local-file-server
npm i # installs express & pkg modules
```
3. Optionally add the script folder to your PATH.
## Usage
You can run the server with `npm start` or `node main.js`, but in this example\
we'll assume you have added the `serve` script to your PATH.
```bash
serve # serve the current directory on port 3000
serve . 8000 # serve the current directory on the given port
serve /path/to # serve the given directory on port 3000
serve /path/to 8000 # serve the given directory on the given port
```
## Building
If you want to build the executables yourself, you need to:
- install [nodejs](https://nodejs.org/en/)
- install npm (usually included with nodejs)
then run the following commands:
```sh
npm i # installs express & pkg modules
npm run build # builds win, mac & linux binaries to ./build
# You can also only build for one platform:
npm run build:win # builds win binary to ./build/win
npm run build:mac # builds mac binary to ./build/mac
npm run build:linux # builds linux binary to ./build/linux
```
## Issues & Improvement Ideas
If you have any issues or ideas, please [open an issue](https://github.com/nlfmt/local-file-server/issues).
## License
This Project uses the MIT License, see the [LICENSE](https://github.com/nlfmt/local-file-server/blob/master/LICENSE) file for more information.