754 B
home.go
package controllers
import (
"net/http"
"github.com/readysite/readysite/pkg/application"
)
// Home returns the home controller.
func Home() (string, *HomeController) {
return "home", &HomeController{}
}
// HomeController handles marketing pages.
type HomeController struct {
application.BaseController
}
// Setup registers routes.
func (c *HomeController) Setup(app *application.App) {
c.BaseController.Setup(app)
http.Handle("GET /", app.Serve("index.html", nil))
http.Handle("GET /about", app.Serve("about.html", nil))
http.Handle("GET /pricing", app.Serve("pricing.html", nil))
}
// Handle returns a request-scoped controller instance.
func (c HomeController) Handle(r *http.Request) application.Controller {
c.Request = r
return &c
}