created some structure and a concept
This commit is contained in:
13
internal/rest_handler/create_session.go
Normal file
13
internal/rest_handler/create_session.go
Normal file
@@ -0,0 +1,13 @@
|
||||
package rest_handler
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"gitea.elara.ws/Hazel/hangman/internal/session"
|
||||
"github.com/labstack/echo/v4"
|
||||
)
|
||||
|
||||
func CreateSession(c echo.Context) error {
|
||||
s := session.NewSession()
|
||||
return c.JSON(http.StatusOK, s)
|
||||
}
|
||||
13
internal/view_handler/create_session.go
Normal file
13
internal/view_handler/create_session.go
Normal file
@@ -0,0 +1,13 @@
|
||||
package view_handler
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/labstack/echo/v4"
|
||||
)
|
||||
|
||||
func CreateSession(c echo.Context) error {
|
||||
return c.Render(http.StatusOK, "create_session", map[string]interface{}{
|
||||
"name": "create session",
|
||||
})
|
||||
}
|
||||
13
internal/view_handler/create_user.go
Normal file
13
internal/view_handler/create_user.go
Normal file
@@ -0,0 +1,13 @@
|
||||
package view_handler
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/labstack/echo/v4"
|
||||
)
|
||||
|
||||
func CreateUser(c echo.Context) error {
|
||||
return c.Render(http.StatusOK, "create_user", map[string]interface{}{
|
||||
"name": c.Param("name"),
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user