Created
June 19, 2019 01:24
-
-
Save amorist/67b5d3bb152ba2c8a0bbed4865d6778a to your computer and use it in GitHub Desktop.
go static html server
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 ( | |
"log" | |
"net/http" | |
) | |
func main() { | |
fs := http.FileServer(http.Dir("./")) | |
http.Handle("/", fs) | |
log.Println("Listening...") | |
http.ListenAndServe(":3000", nil) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment