update README.md

This commit is contained in:
Benny~ 2020-02-09 18:49:32 +08:00
parent 4ae6453981
commit 6839c6a7b0
No known key found for this signature in database
GPG Key ID: 7B84C5D3219A9B31

View File

@ -31,14 +31,15 @@ It's basically between `ExpressJS` and `Fiber`, much faster than the `http` pack
## Usage ## Usage
Regarding the `IMG_PATH` section in `config.json`, if you are serving images at `https://example.com/pics/tsuki.jpg` and your files are at `/var/www/image/pics/tsuki.jpg`, then `IMG_PATH` shall be `/var/www/image`. Regarding the `IMG_PATH` section in `config.json`.
If you are serving images at `https://example.com/pics/tsuki.jpg` and
your files are at `/var/www/image/pics/tsuki.jpg`, then `IMG_PATH` shall be `/var/www/image`.
1. Edit the `config.json` to face your need, default convert quality is 80%. 1. Edit the `config.json` to face your need, default convert quality is 80%.
2. Run the binary like this: `./webp_server`, use `screen` or `tmux` to hold it currently. 2. Run the binary like this: `./webp_server`, use `screen` or `tmux` to hold it currently.
3. Let Nginx to `proxy_pass http://localhost:3333/;` 3. Let Nginx to `proxy_pass http://localhost:3333/;`
## TODO ## TODO
- [ ] This version doesn't support header-based-output, which means Safari users will not see the converted `webp` images, this should be fixed in later releases. - [ ] This version doesn't support header-based-output, which means Safari users will not see the converted `webp` images, this should be fixed in later releases.
- [ ] Multi platform support. - [ ] Multi platform support.
@ -49,3 +50,4 @@ go get github.com/gofiber/fiber
go get github.com/chai2010/webp go get github.com/chai2010/webp
go build webp_server.go go build webp_server.go
``` ```
**Due to the limitations of webp module, you can't cross compile this tool.**