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 (
|
import (
|
||||||
"flag"
|
"flag"
|
||||||
"fmt"
|
"fmt"
|
||||||
"justcaptcha/internal/captcha"
|
|
||||||
"justcaptcha/internal/handlers"
|
"justcaptcha/internal/handlers"
|
||||||
"justcaptcha/pkg/server"
|
"justcaptcha/pkg/server"
|
||||||
"log"
|
"log"
|
||||||
@ -30,12 +29,10 @@ func main() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
captcha.Init(*captchaExpiry)
|
hand := handlers.New(*captchaExpiry)
|
||||||
|
|
||||||
hand := handlers.New()
|
|
||||||
srv := server.NewHttpServer()
|
srv := server.NewHttpServer()
|
||||||
|
|
||||||
srv.GET("/", hand.New)
|
srv.POST("/", hand.New)
|
||||||
srv.POST("/:captcha", hand.Solve)
|
srv.POST("/:captcha", hand.Solve)
|
||||||
srv.GET("/:captcha", hand.IsSolved)
|
srv.GET("/:captcha", hand.IsSolved)
|
||||||
srv.GET("/:captcha/image", hand.Image)
|
srv.GET("/:captcha/image", hand.Image)
|
||||||
|
Loading…
Reference in New Issue
Block a user