diff options
author | Emile <hanemile@protonmail.com> | 2019-09-23 12:24:36 +0200 |
---|---|---|
committer | Emile <hanemile@protonmail.com> | 2019-09-23 12:24:36 +0200 |
commit | 1b3545a9f69f61a503f1c996c199c38b11a78e7e (patch) | |
tree | be613c608e0c3b20f0b8256dcb88f74989d31c63 | |
parent | 67f80f6b6bb8fe8e1b997cb839859901d61b673a (diff) |
added some comments
-rw-r--r-- | server.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/server.go b/server.go index 69d528b..586d962 100644 --- a/server.go +++ b/server.go @@ -16,13 +16,18 @@ var ( ) func main() { + // Parse the command line flags initFlags() + + // Define a new gorilla/mux router and define some endpoints r := mux.NewRouter() r.HandleFunc("/", indexHandler) r.HandleFunc("/dumpall", dumpallHandler) r.HandleFunc("/{station}/{name}", getHandler) + // Start the http server using the port provided using command line arguments + // The Default port is 8080 log.Fatal(http.ListenAndServe(fmt.Sprintf(":%d", port), r)) } |