Added parts animation for rental.

This commit is contained in:
2019-12-31 13:07:15 +01:00
parent f430ec822e
commit a15c0ce995
39 changed files with 851 additions and 9 deletions

12
main.go
View File

@@ -16,6 +16,8 @@ import (
const (
staticDir = "static"
staticDirPrefix = "/static/"
jsDir = "js"
jsDirPrefix = "/js/"
envPrefix = "SCHNITTFEST_"
pwdString = "PASSWORD" // do not log passwords!
@@ -63,6 +65,16 @@ func setupRouter() *mux.Router {
fs.ServeHTTP(w, r)
}).Methods("GET")
// js
js := http.StripPrefix(jsDirPrefix, http.FileServer(http.Dir(jsDir)))
router.PathPrefix(jsDirPrefix).HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
if !disableCache {
w.Header().Add("Cache-Control", "max-age=3600")
}
js.ServeHTTP(w, r)
}).Methods("GET")
// pages
router.HandleFunc("/", pages.LandingPageHandler).Methods("GET")