Skip to content

πŸ“š The open-source, offline-first Notion, Obsidian & Confluence alternative. Advanced Markdown, multi-tenant teams, OIDC/SSO, and local S3 backups. Deploy in one command.

Add dev middleware

Smaug6739d85e2d04e9b9
diff --git a/backend/router/router.go b/backend/router/router.go
index 945de454..7401300e 100644
--- a/backend/router/router.go
+++ b/backend/router/router.go
@@ -9,11 +9,21 @@ import (
"github.com/gin-gonic/gin"
)
+/*
+// Fake delay for dev to test reactivity
+
+ func DelayMiddleware(delay time.Duration) gin.HandlerFunc {
+ return func(c *gin.Context) {
+ time.Sleep(delay)
+ c.Next()
+ }
+ }
+*/
func InitRouter(app *app.App) *gin.Engine {
router := gin.New()
router.Use(gin.Recovery())
-
+ // router.Use(DelayMiddleware(1 * time.Second))
// Configurer les proxys et CORS
router.SetTrustedProxies([]string{"127.0.0.1", "localhost"})
router.Use(cors.New(cors.Config{