https://github.com/probably-not/servedir
The simple file server command. Why? Because laziness, that's why
https://github.com/probably-not/servedir
fileserver golang lazy
Last synced: 11 months ago
JSON representation
The simple file server command. Why? Because laziness, that's why
- Host: GitHub
- URL: https://github.com/probably-not/servedir
- Owner: probably-not
- License: mit
- Created: 2019-10-02T08:28:11.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-02-25T04:04:50.000Z (almost 3 years ago)
- Last Synced: 2025-01-07T06:32:12.583Z (about 1 year ago)
- Topics: fileserver, golang, lazy
- Language: Go
- Size: 4.47 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# servedir
The simple file server command.
This code is literally to simplify my life by making it so that instead of typing a few words in the command line to open a file server, I only have to write one word (not including options like port and directory).
Why did I do this? Because I'm a lazy guy who would rather make my life easier by writing less in the terminal.
- [servedir](#servedir)
- [Installation](#installation)
- [Usage](#usage)
- [Now With Brotli Compression!!](#now-with-brotli-compression)
- [To adjust the settings](#to-adjust-the-settings)
## Installation
```bash
go get github.com/probably-not/servedir
cd $(go env GOPATH)/src/github.com/probably-not/servedir
go install
```
## Usage
To serve the current directory on port `8080`:
```bash
servedir
```
To serve the current directory on a different port:
```bash
servedir --port 8000
```
Or, using the shorthand:
```bash
servedir -p 8000
```
To serve a different directory on port `8080`:
```bash
servedir --dir /some/random/dir
```
Or, using the shorthand:
```bash
servedir -d /some/random/dir
```
## Now With Brotli Compression!!
Well, some time passed, and then I realized, what if I want to see how my files are compressed? So... I added some brotli compression!
To serve files with compression, simply run the normal command. Compression and best compression is on by default.
### To adjust the settings
To turn off compression:
```bash
servedir --compression false
```
Or, using the shorthand:
```bash
servedir -c false
```
To change the level of compression (can be between 0 and 11):
```bash
servedir --level 1
```
Or, using the shorthand:
```bash
servedir -l 1
```