(This is a sample website - you’ll be building a site like this on our Next.js tutorial.)
This website also has examples of the four most common rendering strageties that Next.js offers when working with an external API:
Blog
Older Example Pages
API Routes
/api/time/*
Description: Will current time. Meant to test if Cloudflare or Vercel is caching the API routes.
/api/headers
Description: Will output headers that were recieved from the server. Meant to see what headers Cloudflare and Vercel append.
/api/cache/johndoe
Description: The example on the vercel website for caching serverless functions. Caches the response and serves it fresh every 50 seconds.
/api/cache/v-stale
Description: A simple example returning the number of minutes past the hour and the number of seconds past the minute. The cache is fresh for 0-10 seconds; stale for 10-59 seconds, but served from the cache, and in the background is revalidated; completely stale after 60 seconds and must be fetched from the server.
Math Routes
These are just joke routes meant to test how vercel handles more than 12 API functions
/api/math/randyRandom
Description: Returns a random number. The number is cached in the Vercel CDN for 10 minutes.
Math Constants
These always return a constant
