clavitor/design-system/server.go

21 lines
489 B
Go

package main
import (
"log"
"net/http"
)
func main() {
fs := http.FileServer(http.Dir("."))
// Wrap to add no-cache headers
handler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Cache-Control", "no-cache, no-store, must-revalidate")
w.Header().Set("Pragma", "no-cache")
w.Header().Set("Expires", "0")
fs.ServeHTTP(w, r)
})
log.Println("Serving on http://127.0.0.1:8888")
log.Fatal(http.ListenAndServe("127.0.0.1:8888", handler))
}