Merge branch 'no_tests' into jonas_master

This commit is contained in:
Jonathan Leibiusky @xetorthio
2017-06-07 10:20:14 -03:00
2 changed files with 10 additions and 2 deletions

View File

@@ -1,4 +1,4 @@
FROM golang:1.7 FROM golang:1.8
# Copy the runtime dockerfile into the context as Dockerfile # Copy the runtime dockerfile into the context as Dockerfile
COPY Dockerfile.run /go/bin/Dockerfile COPY Dockerfile.run /go/bin/Dockerfile

10
api.go
View File

@@ -5,6 +5,7 @@ import (
"log" "log"
"net/http" "net/http"
"os" "os"
"time"
gh "github.com/gorilla/handlers" gh "github.com/gorilla/handlers"
"github.com/gorilla/mux" "github.com/gorilla/mux"
@@ -98,9 +99,16 @@ func main() {
r.PathPrefix("/").Handler(negroni.New(negroni.Wrap(corsHandler(corsRouter)))) r.PathPrefix("/").Handler(negroni.New(negroni.Wrap(corsHandler(corsRouter))))
n.UseHandler(r) n.UseHandler(r)
httpServer := http.Server{
Addr: "0.0.0.0:" + config.PortNumber,
Handler: n,
IdleTimeout: 30 * time.Second,
ReadHeaderTimeout: 5 * time.Second,
}
go func() { go func() {
log.Println("Listening on port " + config.PortNumber) log.Println("Listening on port " + config.PortNumber)
log.Fatal(http.ListenAndServe("0.0.0.0:"+config.PortNumber, n)) log.Fatal(httpServer.ListenAndServe())
}() }()
// Now listen for TLS connections that need to be proxied // Now listen for TLS connections that need to be proxied