handler/README.md

28 lines
518 B
Markdown
Raw Normal View History

2022-04-18 18:13:53 -04:00
# Handler
Provides simple HTTP file server; Its so simple to do with golang; looks like nobody bothers to provide a ready-to-download package to actually do it.
2022-04-18 18:18:57 -04:00
## Installation
```golang
go install git.thirdage.dev/night/handler@latest
```
2022-04-18 18:13:53 -04:00
## Examples
2022-04-18 18:18:57 -04:00
Calling without any arguments defaults to serving `./` at `0.0.0.0:8080`
2022-04-18 18:13:53 -04:00
2022-04-18 18:15:16 -04:00
```golang
$ ./handler
```
2022-04-18 18:13:53 -04:00
### Changing default settings
2022-04-18 18:15:42 -04:00
- `a` sets ip address
- `p` sets port
- `d` sets directory to serve
2022-04-18 18:13:53 -04:00
```golang
$ ./handler -a 127.0.0.1 -p 3000 -d ./foo/bar
```