21 lines
490 B
Go
21 lines
490 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://192.168.1.16:8888")
|
|
log.Fatal(http.ListenAndServe("0.0.0.0:8888", handler))
|
|
} |