Static path
This commit is contained in:
8
main.go
8
main.go
@@ -7,11 +7,11 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
// http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
||||||
fmt.Fprintf(w, "Hello! you've requested %s\n", r.URL.Path)
|
// fmt.Fprintf(w, "Hello! you've requested %s\n", r.URL.Path)
|
||||||
})
|
// })
|
||||||
|
|
||||||
http.Handle("/static", http.FileServer(http.Dir("./static")))
|
http.Handle("/", http.FileServer(http.Dir("./static")))
|
||||||
|
|
||||||
port := os.Getenv("PORT")
|
port := os.Getenv("PORT")
|
||||||
if port == "" {
|
if port == "" {
|
||||||
|
|||||||
Reference in New Issue
Block a user