Skip to content

Instantly share code, notes, and snippets.

@cauefcr
Created July 10, 2019 22:39
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 cauefcr/ff9661769722bbe42cff3e9a21d291bd to your computer and use it in GitHub Desktop.
Save cauefcr/ff9661769722bbe42cff3e9a21d291bd to your computer and use it in GitHub Desktop.
package main
import "net/http"
import "os"
func main() {
fs := http.FileServer(http.Dir(os.Args[1]))
http.Handle("/", http.StripPrefix("/", fs))
http.ListenAndServe(":"+os.Args[2], nil)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment