Skip to content

Instantly share code, notes, and snippets.

@johnson86tw
Created September 22, 2020 15:15
Show Gist options
  • Save johnson86tw/be50eea3d74047ec0a8b2fef6358ef56 to your computer and use it in GitHub Desktop.
Save johnson86tw/be50eea3d74047ec0a8b2fef6358ef56 to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"log"
"net/http"
)
func main() {
http.Handle("/", http.FileServer(http.Dir("./public/")))
fmt.Println("server is listening up on port 3000")
err := http.ListenAndServe(":3000", nil)
if err != nil {
log.Fatal(err)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment