diff --git a/functions.go b/functions.go index fea10d1..00b52eb 100644 --- a/functions.go +++ b/functions.go @@ -1,9 +1,6 @@ package main import ( - "fmt" - "net/http" - "git.nils.zone/clientserverapi/server/storage" ) @@ -13,7 +10,3 @@ func check(err error) { } storage.GetComputers() } - -func homePage(w http.ResponseWriter, r *http.Request) { - fmt.Fprintf(w, "Nothing here...") -} diff --git a/main.go b/main.go index 110cca3..fe795bd 100644 --- a/main.go +++ b/main.go @@ -2,12 +2,17 @@ package main import ( "flag" + "fmt" "log" "net/http" "github.com/gorilla/mux" ) +func homePage(w http.ResponseWriter, r *http.Request) { + fmt.Fprintf(w, "Nothing here...") +} + func handleRequests(runmode string) { // creates a new instance of a mux router router := mux.NewRouter().StrictSlash(true) diff --git a/shared/functions.go b/shared/functions.go new file mode 100644 index 0000000..02926e4 --- /dev/null +++ b/shared/functions.go @@ -0,0 +1,12 @@ +package shared + +import ( + "git.nils.zone/clientserverapi/server/storage" +) + +func check(err error) { + if err != nil { + panic(err) + } + storage.GetComputers() +}