more restructuring

This commit is contained in:
Nils Stinnesbeck 2020-12-11 21:34:34 +01:00
parent 199aa57c96
commit 4ba952092c
Signed by: nils
GPG Key ID: 86D4882C6C6CA48B
3 changed files with 17 additions and 7 deletions

View File

@ -1,9 +1,6 @@
package main package main
import ( import (
"fmt"
"net/http"
"git.nils.zone/clientserverapi/server/storage" "git.nils.zone/clientserverapi/server/storage"
) )
@ -13,7 +10,3 @@ func check(err error) {
} }
storage.GetComputers() storage.GetComputers()
} }
func homePage(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "Nothing here...")
}

View File

@ -2,12 +2,17 @@ package main
import ( import (
"flag" "flag"
"fmt"
"log" "log"
"net/http" "net/http"
"github.com/gorilla/mux" "github.com/gorilla/mux"
) )
func homePage(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "Nothing here...")
}
func handleRequests(runmode string) { func handleRequests(runmode string) {
// creates a new instance of a mux router // creates a new instance of a mux router
router := mux.NewRouter().StrictSlash(true) router := mux.NewRouter().StrictSlash(true)

12
shared/functions.go Normal file
View File

@ -0,0 +1,12 @@
package shared
import (
"git.nils.zone/clientserverapi/server/storage"
)
func check(err error) {
if err != nil {
panic(err)
}
storage.GetComputers()
}