This is a quickstart for Vercel Serverless Functions. For Vercel Edge Functions, check this article.
Create a Redis database using Upstash Console or
Upstash CLI. Select the same region with your
Vercel Serverless Function to minimize the latency. Copy the
UPSTASH_REDIS_REST_URL
and UPSTASH_REDIS_REST_TOKEN
for the next steps.
We will create a Next.js application and deploy to Vercel.
Install @upstash/redis:
Update app/api/hello.js
with the template below to test the Redis client:
We’ll place the credentials in the .env
file as below:
You can run the app locally: npm run dev
and check
http://localhost:3000/api/hello
Deploy your app with vercel deploy
You can also integrate your Vercel projects with Upstash using Vercel Integration module. Check this article.
This is a quickstart for Vercel Serverless Functions. For Vercel Edge Functions, check this article.
Create a Redis database using Upstash Console or
Upstash CLI. Select the same region with your
Vercel Serverless Function to minimize the latency. Copy the
UPSTASH_REDIS_REST_URL
and UPSTASH_REDIS_REST_TOKEN
for the next steps.
We will create a Next.js application and deploy to Vercel.
Install @upstash/redis:
Update app/api/hello.js
with the template below to test the Redis client:
We’ll place the credentials in the .env
file as below:
You can run the app locally: npm run dev
and check
http://localhost:3000/api/hello
Deploy your app with vercel deploy
You can also integrate your Vercel projects with Upstash using Vercel Integration module. Check this article.