diff options
author | Alexander Neonxp Kiryukhin <i@neonxp.ru> | 2024-10-06 17:47:06 +0300 |
---|---|---|
committer | Alexander Neonxp Kiryukhin <i@neonxp.ru> | 2024-10-06 18:30:24 +0300 |
commit | 3442a92f359b35a76244dfc4f2e55a34d4ec1b2b (patch) | |
tree | 982fdb2d288b79fe664fe7ba5c7d1803ce839db4 /cmd | |
parent | 6160b4fdc5f37e4ceaa6b3c5acc855f466049d61 (diff) |
Фикс ссылок + обработка ошибок
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/app/serve/serve.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/cmd/app/serve/serve.go b/cmd/app/serve/serve.go index dcc296b..0609083 100644 --- a/cmd/app/serve/serve.go +++ b/cmd/app/serve/serve.go @@ -25,12 +25,14 @@ func Run(c *cli.Context) error { e := echo.New() + e.HTTPErrorHandler = handler.ErrorHandler + e.Use(middleware.Recover()) e.Use(middleware.Logger()) e.GET("/", h.Index) - e.GET("/random", h.Random) e.GET("/quote/:id", h.Quote) + e.GET("/random", h.Random) e.GET("/add", h.AddQuote) e.POST("/add", h.AddQuotePost) e.GET("/add/success", h.AddQuoteSuccess) |