Skip to content

Examples

We have set up many examples using different libraries and frameworks. Each example has a lagoss-dev script that uses lagoss 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

Reply with HTML

This example replies with HTML, setting the proper Content-Type header. See the code

Reply with JSON

This example replies with JSON, setting the proper Content-Type header. See the code

Libraries

Drizzle with Turso

This example uses Drizzle, a TypeScript ORM that has a SQL-like syntax with Turso as a distributed SQLite database, with typesafe queries and migrations. See the code

HatTip

This example uses HatTip, a minimalist express-like library that runs anywhere, via Lagoss's adapter. See the code

Hono

This example uses Hono, a small, simple, and ultrafast web framework, via Lagoss's adapter. See the code

Nitro

This example uses Nitro, a library to build and deploy universal JavaScript servers, via Lagoss's preset. See the code

Neon

This example uses Neon with their Serverless driver (@neondatabase/serverless) to make PostgreSQL queries on the edge. See the code

PlanetScale Serverless Driver

This example uses PlanetScale with their Serverless Driver (@planetscale/database) to make SQL queries on the edge. See the code

Preact CSR

This example uses Preact to client-side render an app. See the code

Preact SRR

This example uses Preact to server-side render an app and hydrate on the client. See the code

React CSR

This example uses React to client-side render an app. See the code

React SSR

This example uses React to server-side render an app and hydrate on the client. See the code

React SSR with streaming

This example uses React to server-side render an app, stream the HTML, and hydrate on the client. See the code

Satori

This example uses Satori to render React and HTML/CSS to SVG. See the code

Sidra

This example uses Sidra, a library to create servers using TypeScript decorators with NestJS-like API. See the code

Turso

This example uses Turso to make SQLite queries on the edge. See the code

tRPC

This example uses tRPC server, to build typesafe APIs. See the code

Upstash Redis

This example uses Upstash Redis to make Redis requests over HTTP. See the code

Upstash Rate Limit

This example uses Upstash Rate Limit to easily create rate limits via Redis over HTTP. See the code

vite-plugin-ssr

This example uses vite-plugin-ssr to render static and dynamic React pages. See the code

Xata

This example uses Xata, a modern serverless type-safe database. See the code

Frameworks

Astro

This example uses Astro, a static site generator, with both SSR via Lagoss's adapter and prerendering. See the code

Nuxt

This example uses Nuxt, the intuitive web framework for Vue, with SSR via Lagoss's preset. See the code

Nuxt Complex

This example uses Nuxt with multiple pages, layouts, api routes and more. See the code

Rakkas

This example uses Rakkas, a React framework powered by Vite, with SSR via Lagoss's adapter. See the code

Remix

This example uses Remix, a full-stack React framework, with SSR via Lagoss's integration. See the code

SvelteKit

This example uses SvelteKit, the Svelte framework, with SSR via Lagoss's adapter. See the code