---
title: "Build and Deploy a Global Serverless Nuxt SSR App with Cloudflare Hyperdrive and Postgres"
description: "A Nuxt SSR app on Cloudflare Pages can query Neon Postgres through Hyperdrive by routing Drizzle's pg-proxy driver to a separate Hono-based Cloudflare Worker that holds the Hyperdrive binding and runs queries with node-postgres."
url: "https://swe.quest/articles/build-and-deploy-a-global-serverless-nuxt-ssr-app-with-cloudflare-hyperdrive-32566cf4580232ef"
canonical: "https://neon.com/blog/build-and-deploy-global-serverless-nuxt-ssr-app-with-cloudflare-hyperdrive-and-postgres"
source: "Neon"
published: "2024-04-05"
difficulty: "medium"
kind: "How-to"
reading_minutes: 12
tags: ["serverless","postgres","cdn-edge","javascript","caching"]
---

# Build and Deploy a Global Serverless Nuxt SSR App with Cloudflare Hyperdrive and Postgres

A post on [Neon](https://swe.quest/sources/neon.md), published 2024-04-05, 12 min read, How-to. Original: [https://neon.com/blog/build-and-deploy-global-serverless-nuxt-ssr-app-with-cloudflare-hyperdrive-and-postgres](https://neon.com/blog/build-and-deploy-global-serverless-nuxt-ssr-app-with-cloudflare-hyperdrive-and-postgres)

## Summary

A Nuxt SSR app on Cloudflare Pages can query Neon Postgres through Hyperdrive by routing Drizzle's pg-proxy driver to a separate Hono-based Cloudflare Worker that holds the Hyperdrive binding and runs queries with node-postgres. The detour through a Worker exists because Pages Functions don't fully support node-postgres yet, which breaks local Nuxt builds. The walkthrough covers the nitro cloudflare-pages preset, creating the Hyperdrive config from a pooled Neon connection string, wrangler.toml with node\_compat, the Worker's /query endpoint, and the Drizzle proxy driver. Hyperdrive's default cache serves responses for 60 seconds with a 15-second stale-while-revalidate window. The example endpoints are unauthenticated and must be locked down before production use.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Serverless](https://swe.quest/tags/serverless.md) (Backend & APIs)
- [PostgreSQL](https://swe.quest/tags/postgres.md) (Data & databases)
- [CDN & edge](https://swe.quest/tags/cdn-edge.md) (Infrastructure)
- [JavaScript](https://swe.quest/tags/javascript.md) (Languages)
- [Caching](https://swe.quest/tags/caching.md) (Backend & APIs)

## Prerequisites

- Nuxt server routes
- Cloudflare Workers and wrangler
- Drizzle ORM
- PostgreSQL connection strings ([easy posts on PostgreSQL](https://swe.quest/tags/postgres.md?difficulty=easy))

## Keywords

Cloudflare Hyperdrive, Neon, Nuxt, Drizzle ORM, Cloudflare Pages, Cloudflare Workers, Hono, node-postgres

## Related posts

- [Build a serverless API using Cloudflare Workers, Drizzle ORM, and Neon](https://swe.quest/articles/build-a-serverless-api-using-cloudflare-workers-drizzle-orm-and-neon-f83c472c9d399a17.md): Neon · 2023-05-30 · Medium · 9 min read · Serverless, PostgreSQL, TypeScript, Schema migrations
  A step-by-step setup for a serverless TypeScript API on Cloudflare Workers that uses Hono for routing, Drizzle ORM for schema definition and migrations, and Neon serverless Postgres for storage.
- [Sub-10ms Postgres queries for Vercel Edge Functions](https://swe.quest/articles/sub-10ms-postgres-queries-for-vercel-edge-functions-6bc9caef6fab65ca.md): Neon · 2023-07-10 · Medium · 3 min read · PostgreSQL, Serverless, CDN & edge, Performance engineering, TypeScript
  Neon's serverless Postgres driver now supports SQL-over-HTTP via fetch, and Neon's proxy adds opt-in experimental connection caching (\`fetchConnectionCache\`).
- [Using Hyperdrive with Neon and Cloudflare Workers: FAQ](https://swe.quest/articles/using-hyperdrive-with-neon-and-cloudflare-workers-faq-3467430ed9174f03.md): Neon · 2024-12-26 · Medium · 5 min read · PostgreSQL, Serverless, CDN & edge, Caching, Performance engineering
  Cloudflare Hyperdrive is a globally distributed connection pooler and read-query cache for Workers.
- [How to build a complete Next.js app with Vercel and CockroachDB](https://swe.quest/articles/how-to-build-a-complete-next-js-app-with-vercel-and-cockroachdb-31ba89caae01e73a.md): Cockroach Labs · 2022-04-29 · Medium · 11 min read · React, Serverless, Databases, Frontend, JavaScript
  A step-by-step build of a social events app using Next.js pages, Vercel serverless API routes, and a CockroachDB free-tier cluster accessed via the Node.js pg driver.
- [How to use Postgres at the Edge](https://swe.quest/articles/how-to-use-postgres-at-the-edge-9d5045c1101b2176.md): Neon · 2023-09-19 · Medium · 4 min read · PostgreSQL, Serverless, CDN & edge, JavaScript
  Standard Postgres can't be reached from V8-isolate edge runtimes like Vercel Edge Functions because they don't support raw TCP.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
