Guides  ›  Lifecycle  ›  State ← PREV NEXT →

State

Every handler receives a fresh request state.

function handler(state) {
  console.log(state.req.pathname)
  console.log(state.route.paths)
  console.log(state.mode)

  state.data.title = 'Hello'
  state.page.title = 'Home'
  return '<h1>Hello</h1>'
}

req, res, data, and page belong to the request. Configuration and plugins are inherited from the server. See State properties.

Next: Request info →

Tools for business systems.