Skip to content

Instantly share code, notes, and snippets.

@g14a
Created June 26, 2018 04:56
Show Gist options
  • Save g14a/bc72d5957edc33a655067555e0a85cda to your computer and use it in GitHub Desktop.
Save g14a/bc72d5957edc33a655067555e0a85cda to your computer and use it in GitHub Desktop.
package main
import (
"net/http"
"github.com/rs/cors"
)
func main() {
c := cors.AllowAll()
mux := http.NewServeMux()
mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
http.ServeFile(w, r, "map.html")
})
handler := c.Handler(mux)
http.ListenAndServe(":3000", handler)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment