Created
August 20, 2019 14:05
-
-
Save noateden/d4c5e0d0fcc5e985ac0666390dee9ab2 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 ( | |
"net/http" | |
) | |
func main() { | |
http.HandleFunc("/api", api.ApiRoot) | |
http.Handle("/", http.FileServer(http.Dir("public"))) | |
http.ListenAndServe(":8080", nil) | |
} | |
func ApiRoot(rw http.ResponseWriter, r *http.Request) { | |
_, _ = rw.Write([]byte("Hello World!")) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment