From b155900579d6a371ed25b846d4e29a88046afa94 Mon Sep 17 00:00:00 2001 From: "Alexander \"Arav\" Andreev" Date: Thu, 20 Oct 2022 22:50:49 +0400 Subject: [PATCH] GET / was changed to POST / for a new CAPTCHA creation. And now captcha db is being initialised in handlers. --- cmd/justcaptchad/main.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/cmd/justcaptchad/main.go b/cmd/justcaptchad/main.go index a59d3b1..5efaaef 100644 --- a/cmd/justcaptchad/main.go +++ b/cmd/justcaptchad/main.go @@ -3,7 +3,6 @@ package main import ( "flag" "fmt" - "justcaptcha/internal/captcha" "justcaptcha/internal/handlers" "justcaptcha/pkg/server" "log" @@ -30,12 +29,10 @@ func main() { return } - captcha.Init(*captchaExpiry) - - hand := handlers.New() + hand := handlers.New(*captchaExpiry) srv := server.NewHttpServer() - srv.GET("/", hand.New) + srv.POST("/", hand.New) srv.POST("/:captcha", hand.Solve) srv.GET("/:captcha", hand.IsSolved) srv.GET("/:captcha/image", hand.Image)