Skip to content

Instantly share code, notes, and snippets.

@Pushplaybang
Created October 7, 2018 19:27
Show Gist options
  • Save Pushplaybang/e383afc6fc9bf179f29fa468ccda4dd8 to your computer and use it in GitHub Desktop.
Save Pushplaybang/e383afc6fc9bf179f29fa468ccda4dd8 to your computer and use it in GitHub Desktop.
simplest static file server in Go
package main
import (
"net/http"
"os"
)
func main() {
dir, _ := os.Getwd()
http.ListenAndServe(":3000",http.FileServer(http.Dir(dir+"/public")))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment