mirror of
https://github.com/woodchen-ink/webp_server_go.git
synced 2025-07-18 13:42:02 +08:00
Add broken flag
This commit is contained in:
parent
e45ca996ac
commit
a302eeddc0
@ -3,9 +3,8 @@ package main
|
|||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"flag"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/chai2010/webp"
|
|
||||||
"github.com/gofiber/fiber"
|
|
||||||
"image"
|
"image"
|
||||||
"image/jpeg"
|
"image/jpeg"
|
||||||
"image/png"
|
"image/png"
|
||||||
@ -15,6 +14,9 @@ import (
|
|||||||
"path"
|
"path"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"github.com/chai2010/webp"
|
||||||
|
"github.com/gofiber/fiber"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Config struct {
|
type Config struct {
|
||||||
@ -51,7 +53,12 @@ func main() {
|
|||||||
app.Server = "WebP Server Go"
|
app.Server = "WebP Server Go"
|
||||||
|
|
||||||
// Config Here
|
// Config Here
|
||||||
config := load_config("config.json")
|
var config_path string
|
||||||
|
flag.StringVar(&config_path, "config", "config.json", "/path/to/config.json. (Default: ./config.json)")
|
||||||
|
flag.Parse()
|
||||||
|
flag.PrintDefaults()
|
||||||
|
|
||||||
|
config := load_config(config_path)
|
||||||
|
|
||||||
HOST := config.HOST
|
HOST := config.HOST
|
||||||
PORT := config.PORT
|
PORT := config.PORT
|
||||||
|
Loading…
x
Reference in New Issue
Block a user