🚧 This documentation is not complete yet as Lagon is in development.
Examples

We have set up many examples using different libraries and frameworks. Each example has a lagon-dev script that uses lagon dev to start the example locally, in a few seconds.

Basics

Fetch an API

This example uses fetch() to fetch an API and return the result. See the code (opens in a new tab)

Reply with HTML

This example replies with HTML, setting the proper Content-Type header. See the code (opens in a new tab)

Reply with JSON

This example replies with JSON, setting the proper Content-Type header. See the code (opens in a new tab)

Libraries

HatTip

This example uses HatTip (opens in a new tab), a minimalist express-like library that runs anywhere, via Lagon's adapter. See the code (opens in a new tab)

Hono

This example uses Hono (opens in a new tab), a small, simple, and ultrafast web framework, via Lagon's adapter. See the code (opens in a new tab)

Nitro

This example uses Nitro (opens in a new tab), a library to build and deploy universal JavaScript servers, via Lagon's preset. See the code (opens in a new tab)

Preact client-side rendering

This example uses Preact (opens in a new tab) to client-side render an app. See the code (opens in a new tab)

Preact server-side rendering and hydration

This example uses Preact (opens in a new tab) to server-side render an app and hydrate on the client. See the code (opens in a new tab)

React client-side rendering

This example uses React (opens in a new tab) to client-side render an app. See the code (opens in a new tab)

React server-side rendering and hydration

This example uses React (opens in a new tab) to server-side render an app and hydrate on the client. See the code (opens in a new tab)

React server-side rendering with streaming and hydration

This example uses React (opens in a new tab) to server-side render an app, stream the HTML, and hydrate on the client. See the code (opens in a new tab)

Satori

This example uses Satori (opens in a new tab) to render React and HTML/CSS to SVG. See the code (opens in a new tab)

tRPC

This example uses tRPC (opens in a new tab) server, to build typesafe APIs. See the code (opens in a new tab)

Frameworks

Astro

This example uses Astro (opens in a new tab), a static site generator, with both SSR via Lagon's adapter and prerendering. See the code (opens in a new tab)

Nuxt

This example uses Nuxt (opens in a new tab), the intuitive web framework for Vue, with SSR via Lagon's preset. See the code (opens in a new tab)

Rakkas

This example uses Rakkas (opens in a new tab), a React framework powered by Vite, with SSR via Lagon's adapter. See the code (opens in a new tab)

Remix

This example uses Remix (opens in a new tab), a full-stack React framework, with SSR via Lagon's integration. See the code (opens in a new tab)