From edf05b8e7c47d2acb72408c4b0250434636fbc33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?O=CC=81scar=20M=2E=20Lage?= Date: Wed, 23 Mar 2022 00:24:40 +0100 Subject: [PATCH] Add: Redirect / to WikiHome --- server/app.go | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/server/app.go b/server/app.go index b41148c..2492558 100644 --- a/server/app.go +++ b/server/app.go @@ -10,22 +10,7 @@ import ( ) func WikiHome(c echo.Context) error { - var err error - page, err := store.GetPage("WikiHome") - if err != nil { - fmt.Println(err.Error()) - err := store.AddPage("WikiHome", "This is the home of the wiki") - if err != nil { - log.Panicln(err.Error()) - } - } - fmt.Printf("res: %T\n", page) - unsafe := blackfriday.Run([]byte(page.Body)) - html := bluemonday.UGCPolicy().SanitizeBytes(unsafe) - return c.Render(http.StatusOK, "page.html", map[string]interface{}{ - "page": page, - "html": string(html[:]), - }) + return c.Redirect(http.StatusMovedPermanently, "/WikiHome") } func WikiPage(c echo.Context) error {