Documentation ¶
Index ¶
- type Map
- type Renderer
- type Response
- type Server
- func (s *Server) Handler(route string, props interface{}) http.Handler
- func (s *Server) Middleware(next http.Handler) http.Handler
- func (s *Server) Render(path string, props interface{}) (*Response, error)
- func (s *Server) Respond(w http.ResponseWriter, path string, props interface{})
- func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Map ¶
type Map map[string]interface{}
Map is a convenience function for the common case of passing a map of props into a view
type Response ¶
type Response struct { Status int `json:"status,omitempty"` Headers map[string]string `json:"headers,omitempty"` Body string `json:"body,omitempty"` }
func (*Response) Write ¶
func (res *Response) Write(w http.ResponseWriter)
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func Live ¶
func Live(module *gomod.Module, overlay *overlay.FileSystem, vm js.VM, transformer *transform.Map, wrapProps func(path string, props interface{}) interface{}) *Server
Live server serves view files on the fly. Used during development.
func Static ¶
func Static(fsys fs.FS, vm js.VM, wrapProps func(path string, props interface{}) interface{}) *Server
Static server serves the same files every time. Used during production.
Click to show internal directories.
Click to hide internal directories.