Fresh logo

Concepts

These pages cover the building blocks of a Fresh application. Read them in order for a guided tour, or jump to what you need.

Routing & data

  • Routing — turn files in routes/ into URLs, with dynamic params, catch-alls, and route groups.
  • Routes — what a route file looks like: handler + page, return values, GET vs POST.
  • Context — the ctx object every handler and middleware receives.
  • Middleware — run logic before routes: auth, logging, shared state.

Rendering

  • Layouts — wrap groups of routes in shared UI.
  • App shell — the <html> document around every page.
  • Error pages — render 404s, 500s, and thrown errors.

Interactivity