coba landing page hanan
This commit is contained in:
32
handlers/landingpage.handlers.go
Normal file
32
handlers/landingpage.handlers.go
Normal file
@@ -0,0 +1,32 @@
|
||||
package handlers
|
||||
|
||||
import (
|
||||
"github.com/a-h/templ"
|
||||
"github.com/emarifer/go-templ-project-structure/views/landingpage"
|
||||
|
||||
"github.com/labstack/echo/v4"
|
||||
)
|
||||
|
||||
type LandingPageService interface {
|
||||
}
|
||||
|
||||
func NewLandingPageHandler(us LandingPageService) *LandingPageHandler {
|
||||
return &LandingPageHandler{
|
||||
LandingPageService: us,
|
||||
}
|
||||
}
|
||||
|
||||
type LandingPageHandler struct {
|
||||
LandingPageService LandingPageService
|
||||
}
|
||||
|
||||
func (uh *LandingPageHandler) HendlerShowLandingPage(c echo.Context) error {
|
||||
lp := landingpage.ShowLandingPage("Landing Page", landingpage.BodyLandingPage(), landingpage.CssLandingPage(), landingpage.JsLandingPage())
|
||||
return uh.View(c, lp)
|
||||
}
|
||||
|
||||
func (uh *LandingPageHandler) View(c echo.Context, cmp templ.Component) error {
|
||||
c.Response().Header().Set(echo.HeaderContentType, echo.MIMETextHTML)
|
||||
|
||||
return cmp.Render(c.Request().Context(), c.Response().Writer)
|
||||
}
|
||||
@@ -15,6 +15,13 @@ func SetupRoutesXsample(app *echo.Echo, h *XsampleHandler) {
|
||||
xSample := app.Group("/xsample")
|
||||
xSample.GET("/xsample01", h.Hello)
|
||||
}
|
||||
|
||||
//LANDINGPAGE TESTING
|
||||
func SetupRoutesLandingPage(app *echo.Echo, h *LandingPageHandler) {
|
||||
LandingPage := app.Group("/landingpage")
|
||||
LandingPage.GET("/", h.HendlerShowLandingPage)
|
||||
}
|
||||
|
||||
func SetupRoutesProject(app *echo.Echo) {
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user