1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import { neon } from '@neondatabase/serverless';
export default async function handler(req, res) {
const sql = neon(process.env.DATABASE_URL);
const response = await sql`SELECT * FROM table_name`;
return Response.json({
message: 'A Ok!',
data: response
});
}
export const config = {
runtime: 'edge',
};
Getting Started
Ping Thing
Ping a Neon Serverless Postgres database using a Vercel Edge Function to see the journey your request makes.
Postgres at the Edge
Edge Functions run closer to the user. This minimizes both the number, and length of network round-trips to and from the database, resulting in lower latency response times.
Your Request
Details of your request made to Neon using an Edge Function.
Start
Country
throughNeon Proxy
Region
🇺🇸aws-us-east-1
endNeon Database
Region
🇺🇸aws-us-east-1
Mph
Sec
Mi
Km
How to use Postgres at the Edge
A closer look at how to use Neon's serverless driver with Vercel Edge Functions.
Read postNeon serverless driver
The serverless driver is a drop in replacement for node-postgres and is suitable for use with Vercel Edge Functions.
Learn moreGet started
with Neon
The fully managed multi-cloud Postgres with a generous free tier. We separated storage and compute to offer autoscaling, branching, and bottomless storage.