Skip to content

Instantly share code, notes, and snippets.

@topherPedersen
Created February 10, 2020 21:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save topherPedersen/fcca9ed5a55fe141e661ed0ce879e3ff to your computer and use it in GitHub Desktop.
Save topherPedersen/fcca9ed5a55fe141e661ed0ce879e3ff to your computer and use it in GitHub Desktop.
Simple Web Server for Hosting Static HTML in Golang
// 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