diff options
Diffstat (limited to 'server.go')
-rw-r--r-- | server.go | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -1,8 +1,10 @@ package main import ( + "context" "encoding/json" "fmt" + "net" "net/http" "os" "strings" @@ -16,7 +18,7 @@ import ( var mx *mxlib.Client -func StartAppService(errch chan error) (*http.Server, error) { +func StartAppService(errch chan error, ctx context.Context) (*http.Server, error) { mx = mxlib.NewClient(config.Server, registration.AsToken) err := InitDb() @@ -56,6 +58,9 @@ func StartAppService(errch chan error) (*http.Server, error) { http_server := &http.Server{ Addr: config.ASBindAddr, Handler: checkTokenAndLog(router), + BaseContext: func(net.Listener) context.Context { + return ctx + }, } go func() { err := http_server.ListenAndServe() |