https://github.com/beenotung/upload-server-lite
Minimal web server to accept file upload over the network
https://github.com/beenotung/upload-server-lite
Last synced: 20 days ago
JSON representation
Minimal web server to accept file upload over the network
- Host: GitHub
- URL: https://github.com/beenotung/upload-server-lite
- Owner: beenotung
- License: bsd-2-clause
- Created: 2022-04-24T07:47:25.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2025-03-18T18:32:02.000Z (7 months ago)
- Last Synced: 2025-09-10T11:23:23.984Z (24 days ago)
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/upload-server-lite
- Size: 18.6 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# upload-server-lite
Minimal web server to accept file upload over the network
[](https://www.npmjs.com/package/upload-server-lite)
[](https://bundlephobia.com/package/upload-server-lite)
[](https://bundlephobia.com/package/upload-server-lite)## Installation
```shell
# install as dev dependency
npm i -D upload-server-lite# or install as global package
npm i -g upload-server-lite
```## Usage
**Start the server**:
```shell
> npx upload-server-litelistening on http://127.0.0.1:8100 (lo)
listening on http://192.168.1.3:8100 (wlp3s0)
```**Upload from client**:
If the GUI is available, you use a web browser to upload files through the url printed form the server cli.
If GUI us not available, you can upload with `curl`:
For example:
```shell
> curl -F file=@package.json http://192.168.1.3:8100{
"file": {
"size": 443,
"filepath": "/path_of_cwd/uploads/package.json",
"newFilename": "package.json",
"mimetype": "application/octet-stream",
"mtime": "2022-04-24T08:17:22.199Z",
"originalFilename": "package.json"
}
}
```### Server Options
Format: `npx upload-server-lite [port] [maxFileSize] [secret]`
#### To specify port:
- `npx upload-server-lite 8080`
Remark: The `PORT` environment variable is also supported.
#### To specify maxFileSize:
- `npx upload-server-lite 200K`
Example format of max file size:
- `200` or `200B` => 200 bytes
- `300K` => 300 kilobytes
- `10M` => 10 megabytes
- `2G` => 2 gigabytes
- `1T` => 1 terabyte
- `2P` => 2 petabytes#### To specify access secret:
- `npx upload-server-lite --secret=any-long-string`
Remark: The `SECRET` environment variable is also supported.
#### To specify any options in any order:
- `npx upload-server-lite --secret=any-long-string 8080 10M`
- `npx upload-server-lite 2G 8080`## License
This project is licensed with [BSD-2-Clause](./LICENSE)
This is free, libre, and open-source software. It comes down to four essential freedoms [[ref]](https://seirdy.one/2021/01/27/whatsapp-and-the-domestication-of-users.html#fnref:2):
- The freedom to run the program as you wish, for any purpose
- The freedom to study how the program works, and change it so it does your computing as you wish
- The freedom to redistribute copies so you can help others
- The freedom to distribute copies of your modified versions to others