Skip to content

Instantly share code, notes, and snippets.

@samuelloza
Created June 30, 2020 15:58
Show Gist options
  • Save samuelloza/1cc229beb32e3578a8618a02f07aa1c2 to your computer and use it in GitHub Desktop.
Save samuelloza/1cc229beb32e3578a8618a02f07aa1c2 to your computer and use it in GitHub Desktop.
Server go
package main
import (
"log"
"net/http"
)
func main() {
server := http.NewServeMux()
fs := http.FileServer(http.Dir("./views/"))
server.Handle("/", http.StripPrefix("", fs))
port := "8000"
log.Println("http://localhost:" + port)
http.ListenAndServe(":"+port, server)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment