Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@brydavis
Created September 25, 2019 01:20
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 brydavis/502f92731d386ec1caafb9376742f705 to your computer and use it in GitHub Desktop.
Save brydavis/502f92731d386ec1caafb9376742f705 to your computer and use it in GitHub Desktop.
Basic Root Folder File / Webserver for Static Site Testing
package main
import (
"log"
"net/http"
)
func main() {
http.Handle("/", http.FileServer(http.Dir(".")))
log.Printf("Serving %s on HTTP port: %s\n", ".", "8080")
http.ListenAndServe(":8080", nil)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment