Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alexbinary/webfile
HTTP endpoint that returns files from a directory
https://github.com/alexbinary/webfile
Last synced: 1 day ago
JSON representation
HTTP endpoint that returns files from a directory
- Host: GitHub
- URL: https://github.com/alexbinary/webfile
- Owner: alexbinary
- License: isc
- Created: 2015-09-26T09:14:38.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2015-09-26T09:46:19.000Z (about 9 years ago)
- Last Synced: 2024-10-06T00:48:53.961Z (about 1 month ago)
- Language: JavaScript
- Size: 121 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# webfile
HTTP endpoint that returns files from a directory## Install
```
npm install -g webfile
```## Usage
```
webfile [dir] [port]
```- `dir` is the directory containing the files you want to serve.
Must contain only files, server will crash when trying to serve something else.
Defaults to `./`
- `port` is the port the server should listen on, if omitted a random port is selected.Then visit `http://yourhost:port`. You will get a random file from the specified folder.
Reload to get a new random file.### Example
```
> webfile Pictures/Server running at :::63832
Serving files from /Users/Alex/Pictures
```Files are accessible at http://localhost:63832