15 lines
294 B
Go
15 lines
294 B
Go
package rest_handler
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"gitea.elara.ws/Hazel/hangman/internal/game"
|
|
"gitea.elara.ws/Hazel/hangman/internal/words"
|
|
"github.com/labstack/echo/v4"
|
|
)
|
|
|
|
func CreateSession(c echo.Context) error {
|
|
s := game.NewSession(words.GetRandomWord())
|
|
return c.JSON(http.StatusOK, s)
|
|
}
|