INNER CODE UNIT · Go
scanStatusInterval
Zeus-Labs/ZeusCloud · backend/main.go:21
const scanStatusInterval = 5 * time.Second
func demoMiddleware(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
if os.Getenv("MODE") == constants.DemoEnvModeStr {
if r.Method == http.MethodPost || r.Method == http.MethodPut || r.Method == http.MethodDelete {
http.Error(w, "Demo Mode Not Allowed", http.StatusForbidden)
return
}
}
next.ServeHTTP(w, r)
})
}
func main() {
log.Printf("Mode: %v", os.Getenv("MODE"))
// Connect with Postgres database