Skip to content

Instantly share code, notes, and snippets.

@jvns

jvns/serve.go Secret

Created November 17, 2021 18:09
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 jvns/6147bc21fbb60b0090d543bb5e240134 to your computer and use it in GitHub Desktop.
Save jvns/6147bc21fbb60b0090d543bb5e240134 to your computer and use it in GitHub Desktop.
package main
import (
"net/http"
"os"
)
func main() {
wd, err := os.Getwd()
if err != nil {
panic(err)
}
println("http://localhost:8080/")
panic(http.ListenAndServe(":8080", http.FileServer(http.Dir(wd))))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment