package main import ( "fmt" "log" "net/http" ) func webServer() { // Start web server //Public static files http.Handle("/public/", http.StripPrefix("/public/", http.FileServer(http.Dir("public")))) // Page Handlers // Anything that is responsible for the base elements of a viewable web page http.HandleFunc("/", homePageHandler) log.Print("Service listening on :8080") log.Printf("Web server unexpectedly exiting!: %v", http.ListenAndServe(":8080", nil)) } func homePageHandler(w http.ResponseWriter, r *http.Request) { refreshData() http.Redirect(w, r, fmt.Sprintf("https://app.ynab.com/%s", ynabClient.BudgetID), http.StatusSeeOther) }