Development Tools
Vercel is a platform that puts your website on the internet. Connect your code from GitHub, and Vercel handles everything else—your site goes live automatically.
Traditionally, putting a website online meant renting a server, installing software, configuring security, and manually uploading files. Vercel eliminates all of that. You push code to GitHub, and seconds later your site is live worldwide.
It's free for personal projects, incredibly fast (global CDN), and the deployment experience is unmatched. Push code → see it live in seconds.
Beyond basic hosting, Vercel offers serverless functions, environment variables, custom domains, and powerful integrations that enable full-stack applications.
Put JavaScript files in the /api folder, and they become API endpoints:
// api/hello.js
export default function handler(req, res) {
res.status(200).json({ message: 'Hello World' });
}
Accessible at yoursite.com/api/hello. No server to manage—it
scales automatically.
Store secrets securely in the Vercel dashboard:
// Access in your code const apiKey = process.env.OPENAI_API_KEY;
npm i -g vercel # Install globally vercel # Deploy from terminal vercel dev # Run locally with env vars vercel env pull # Download env vars to .env.local
Every branch and pull request gets its own URL. This lets you:
Add your domain in the Vercel dashboard. Point your DNS to Vercel's servers, and they handle SSL certificates automatically. Renewals, security, everything.
Advanced Vercel usage involves edge functions, fine-tuned caching, monorepo support, and deep configuration that squeezes every millisecond of performance.
Run code at the edge (closest to the user) instead of a single region:
// api/edge-hello.js
export const config = {
runtime: 'edge',
};
export default function handler(req) {
return new Response('Hello from the edge!');
}
Edge functions start in ~1ms vs ~250ms for regular serverless. Perfect for auth checks, A/B testing, and personalization.
Pro Tip
Use Edge for anything that doesn't need Node.js APIs. The cold start difference is dramatic for user experience.
{
"headers": [
{
"source": "/api/(.*)",
"headers": [
{ "key": "Cache-Control", "value": "s-maxage=60" }
]
}
],
"redirects": [
{ "source": "/old", "destination": "/new", "permanent": true }
],
"rewrites": [
{ "source": "/blog/:slug", "destination": "/api/blog?slug=:slug" }
],
"functions": {
"api/heavy.js": {
"memory": 3008,
"maxDuration": 60
}
}
}
s-maxage=31536000, immutable — Cache forever (for hashed assets)s-maxage=60, stale-while-revalidate=300 — Cache 1 min, serve stale for 5 min while revalidatingprivate, no-cache, no-store — Never cache (user-specific data)Performance Secret
stale-while-revalidate is the key to both speed and freshness. Users get cached content instantly while fresh data loads in the background.
Deploy multiple apps from one repo:
{
"buildCommand": "cd packages/web && npm run build",
"outputDirectory": "packages/web/dist",
"installCommand": "npm install --prefix packages/web"
}
// vercel.json
{
"ignoreCommand": "git diff HEAD^ HEAD --quiet -- ./src"
}
vercel logs yoursite.com # Stream production logs vercel inspect deployment-url # Debug a deployment vercel rollback # Revert to previous deployment vercel promote deployment-url # Promote preview to production vercel alias set deployment custom.com # Custom domain for specific deploy
stale-while-revalidate to reduce function invocationsvercel analytics to identify expensive routes