Skip to content
Snippets Groups Projects
Commit 494912df authored by Marius Nersveen's avatar Marius Nersveen
Browse files

Working towards a somewhat functional project

parent b64230f7
No related branches found
No related tags found
No related merge requests found
package main
import (
"Assignment02/handlers"
"encoding/json"
"errors"
"log"
......@@ -11,15 +12,11 @@ import (
"time"
)
type ServerState struct {
startTime time.Time
_useMocking bool
}
func (state ServerState) UseMocking() bool {
return state._useMocking
}
func (state ServerState) UptimeInSeconds() float64 {
return time.Since(state.startTime).Seconds()
}
......@@ -49,6 +46,7 @@ func main() {
yo(&serverState, w, r)
})
log.Println("Starting server on port " + port + " ...")
log.Fatal(http.ListenAndServe(":"+port, nil))
}
......
package handlers
// Dedicated handler for GET requests
func HandleGetRequestForHistoricalPercentage(w http.ResponseWriter, r *http.Request) {
}
\ No newline at end of file
package utils
type ServerState struct {
startTime time.Time
_useMocking bool
}
type CountryRenewableOutput struct {
CountryName string `json:"name"`
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment