aboutsummaryrefslogtreecommitdiff
path: root/server.go
diff options
context:
space:
mode:
Diffstat (limited to 'server.go')
-rw-r--r--server.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/server.go b/server.go
index ce0334a..294ad7f 100644
--- a/server.go
+++ b/server.go
@@ -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()