diff --git a/main.go b/main.go index 6dc5d18..3a9699a 100644 --- a/main.go +++ b/main.go @@ -14,7 +14,7 @@ import ( ) const ( - staticDir = "public/static" + staticDir = "static" staticDirPrefix = "/static/" envPrefix = "SCHNITTFEST_" pwdString = "PASSWORD" // do not log passwords! @@ -23,6 +23,10 @@ const ( defaultHttpReadTimeout = 20 ) +var ( + disableCache = strings.ToLower(os.Getenv("SCHNITTFEST_DISABLE_CACHE")) == "true" +) + func configureLog() { logbuch.Info("Configure logging...") logbuch.SetFormatter(logbuch.NewFieldFormatter("", "\t")) @@ -52,7 +56,10 @@ func setupRouter() *mux.Router { // static content fs := http.StripPrefix(staticDirPrefix, http.FileServer(http.Dir(staticDir))) router.PathPrefix(staticDirPrefix).HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.Header().Add("Cache-Control", "max-age=3600") + if !disableCache { + w.Header().Add("Cache-Control", "max-age=3600") + } + fs.ServeHTTP(w, r) }).Methods("GET") diff --git a/run_dev.cmd b/run_dev.cmd index 0cb4389..f4a38f4 100644 --- a/run_dev.cmd +++ b/run_dev.cmd @@ -2,5 +2,6 @@ set SCHNITTFEST_HOST=localhost:8080 set SCHNITTFEST_LOGLEVEL=debug set SCHNITTFEST_ALLOWED_ORIGINS=* set SCHNITTFEST_TLS_ENABLE=false +set SCHNITTFEST_DISABLE_CACHE=true go run main.go diff --git a/run_dev.sh b/run_dev.sh index 1555ad8..f7c3d31 100755 --- a/run_dev.sh +++ b/run_dev.sh @@ -4,5 +4,6 @@ export SCHNITTFEST_HOST=localhost:8080 export SCHNITTFEST_LOGLEVEL=debug export SCHNITTFEST_ALLOWED_ORIGINS=* export SCHNITTFEST_TLS_ENABLE=false +export SCHNITTFEST_DISABLE_CACHE=true go run main.go diff --git a/static/main.css b/static/main.css index a7344a0..e802e99 100644 --- a/static/main.css +++ b/static/main.css @@ -1 +1 @@ -html,body{font-family:sans-serif} +html,body{font-family:sans-serif;font-size:40px} diff --git a/style/sass/main.scss b/style/sass/main.scss index 468e4cb..4b39cd2 100644 --- a/style/sass/main.scss +++ b/style/sass/main.scss @@ -1,3 +1,4 @@ html, body { font-family: sans-serif; + font-size: 40px; }