Created
January 23, 2022 08:12
-
-
Save ahndmal/fd49f9875d5a619ab40200a00c5ad8f0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"net/http" | |
) | |
func main() { | |
http.HandleFunc("/", func (w http.ResponseWriter, r *http.Request) { | |
fmt.Fprintf(w, "Welcome to my website!") | |
}) | |
fs := http.FileServer(http.Dir("static/")) | |
http.Handle("/static/", http.StripPrefix("/static/", fs)) | |
http.ListenAndServe(":80", nil) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment