GET / was changed to POST / for a new CAPTCHA creation. And now captcha db is being initialised in handlers.
This commit is contained in:
parent
aa6534aa98
commit
b155900579
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user