fix(docker): add dockfile and small fixes (#38)

* fix(docker): add dockfile and small fixes

* chore(readme): small fixes
This commit is contained in:
Hexxa 2021-02-01 21:36:56 +08:00 committed by GitHub
parent c8a3f911e8
commit b0d1cdccfc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 126 additions and 36 deletions

View file

@ -31,11 +31,14 @@ func main() {
if err != nil {
panic(err)
}
if len(opts.Configs) > 0 {
for _, configPath := range opts.Configs {
if strings.HasSuffix(configPath, ".yml") || strings.HasSuffix(configPath, ".yaml") {
fmt.Printf("launching config: %s\n", configPath)
cfg, err = cfg.Load(gocfg.YAML(configPath))
} else if strings.HasSuffix(configPath, ".json") {
fmt.Printf("launching config: %s\n", configPath)
cfg, err = cfg.Load(gocfg.JSON(configPath))
} else {
panic(fmt.Sprintf("unknown config file type (.yml .yaml .json are supported): %s", configPath))
@ -62,6 +65,7 @@ func main() {
panic(err)
}
fmt.Printf("quickshare is listening %d\n", cfg.GrabInt("Server.Port"))
err = srv.Start()
if err != nil {
panic(err)