Add custom http root

Now we are able to let this service run on a different root path.
This commit is contained in:
Thomas Boerger
2019-12-09 14:48:37 +01:00
parent 34dcbeee14
commit c100102253
5 changed files with 29 additions and 2 deletions
+8
View File
@@ -4,6 +4,7 @@ import (
"context"
"os"
"os/signal"
"strings"
"time"
"contrib.go.opencensus.io/exporter/jaeger"
@@ -28,6 +29,13 @@ func Server(cfg *config.Config) cli.Command {
Name: "server",
Usage: "Start integrated server",
Flags: flagset.ServerWithConfig(cfg),
Before: func(c *cli.Context) error {
if cfg.HTTP.Root != "/" {
cfg.HTTP.Root = strings.TrimSuffix(cfg.HTTP.Root, "/")
}
return nil
},
Action: func(c *cli.Context) error {
logger := NewLogger(cfg)