From 4f488d7bd80430988e9d15040909479305239de5 Mon Sep 17 00:00:00 2001 From: ari melody Date: Wed, 20 Mar 2024 00:24:31 +0000 Subject: [PATCH] print to console when server comes online Signed-off-by: ari melody --- main.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 8e7a393..9cc5438 100644 --- a/main.go +++ b/main.go @@ -17,6 +17,8 @@ import ( "github.com/gomarkdown/markdown/parser" ) +const PORT int = 8080 + var mime_types = map[string]string{ "css": "text/css; charset=utf-8", "png": "image/png", @@ -194,5 +196,7 @@ func main() { push_to_db_this_is_a_testing_thing_and_will_be_superfluous_later() http.HandleFunc("/", web_handler) - log.Fatal(http.ListenAndServe(":8080", nil)) + log.Fatal(http.ListenAndServe(fmt.Sprintf(":%d", PORT), nil)) + + fmt.Printf("server now live at http://127.0.0.1:%d\n", PORT) }