mirror of
https://github.com/Kugelschieber/schnittfest.git
synced 2026-01-18 10:20:27 +00:00
Added parts animation for rental.
This commit is contained in:
12
main.go
12
main.go
@@ -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")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user