Skip to content

Instantly share code, notes, and snippets.

@jethrokuan
Created March 27, 2016 05:20
Embed
What would you like to do?
Simple Go Webserver
package main
import (
"fmt"
"log"
"net/http"
)
func main() {
fmt.Println("Serving files in the current directory on port 3000")
http.Handle("/", http.FileServer(http.Dir(".")))
err := http.ListenAndServe(":3000", nil)
if err != nil {
log.Fatal("ListenAndServe: ", err)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment