26 lines
630 B
Go
26 lines
630 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"gitea.elara.ws/Hazel/hangman/internal/rest_handler"
|
|
"gitea.elara.ws/Hazel/hangman/internal/view_handler"
|
|
"github.com/labstack/echo/v4"
|
|
)
|
|
|
|
func main() {
|
|
fmt.Println("wanna play hangman? Well ya cant since it isn't implemented yet..")
|
|
|
|
e := echo.New()
|
|
|
|
e.POST("/api/session", rest_handler.CreateSession)
|
|
e.POST("/api/:session/user", rest_handler.CreateUser)
|
|
e.POST("/api/:session/test-auth", rest_handler.TestAuth)
|
|
e.POST("/api/:session/guess", rest_handler.GuessLetter)
|
|
|
|
e.GET("/", view_handler.CreateSession)
|
|
e.GET("/:name", view_handler.CreateUser)
|
|
|
|
e.Logger.Fatal(e.Start(":1323"))
|
|
}
|