Skip to content

Instantly share code, notes, and snippets.

@surajnarwade
Created August 8, 2017 11:04
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 surajnarwade/51b0d68048d5c86439ca409a26a3b0ad to your computer and use it in GitHub Desktop.
Save surajnarwade/51b0d68048d5c86439ca409a26a3b0ad to your computer and use it in GitHub Desktop.
Simple static file server in go
package main
import (
"net/http"
"os"
)
func main() {
dir, _ := os.Getwd()
http.ListenAndServe(":3000", http.FileServer(http.Dir(dir)))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment