Created
February 10, 2020 21:24
-
-
Save topherPedersen/fcca9ed5a55fe141e661ed0ce879e3ff to your computer and use it in GitHub Desktop.
Simple Web Server for Hosting Static HTML in Golang
This file contains 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
// REFERENCE (Simple Static Web Server in Go): https://stackoverflow.com/questions/26559557/how-do-you-serve-a-static-html-file-using-a-go-web-server | |
package main | |
import ( | |
"net/http" | |
) | |
func main() { | |
http.Handle("/", http.FileServer(http.Dir("./"))) | |
http.ListenAndServe(":3000", nil) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment