Initial commit

This commit is contained in:
Geoff Bourne
2018-05-07 22:16:01 -05:00
commit 17a4bd6515
10 changed files with 658 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
package server
import (
"net/http"
"github.com/sirupsen/logrus"
"github.com/gorilla/mux"
)
var apiRoutes = mux.NewRouter()
func StartApiServer(apiBinding string) {
logrus.WithField("binding", apiBinding).Info("Serving API requests")
go func() {
logrus.WithError(
http.ListenAndServe(apiBinding, apiRoutes)).Error("API server failed")
}()
}