Select Git revision
-
Mathilde Hertaas authoredMathilde Hertaas authored
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
main.go 656 B
package main
import (
"fmt"
"net/http"
"time"
"git.gvk.idi.ntnu.no/Mathilde/cloud/handelers"
)
var serviceStartTime time.Time
func main() {
serviceStartTime = time.Now()
http.HandleFunc("/status/", func(w http.ResponseWriter, r *http.Request) {
handelers.DiagnosticsHandler(w, r, serviceStartTime)
})
http.HandleFunc("/", handelers.HomeHandler)
http.HandleFunc("/countryinfo/v1/info/", handelers.CountryInfoHandler)
http.HandleFunc("/population/", handelers.PopulationHandler)
fmt.Println("Server running on port 8080...")
if err := http.ListenAndServe(":8080", nil); err != nil {
fmt.Printf("Server failed to start: %s\n", err)
}
}