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