Deploy your backend with zero configuration
import express from 'express';
const app = express();
app.get('/', (req, res) => {
res.json({ message: 'Hello from Express!' });
});
export default app;import { Hono } from 'hono';
const app = new Hono();
app.get('/', (c) => {
return c.json({ message: 'Hello from Hono!' });
});
export default app;from fastapi import FastAPI
# Vercel detects this app instance when you deploy.
app = FastAPI()
@app.get("/")
def read_root():
return {"message": "Hello from FastAPI!"}Backends deployed to Vercel receive the benefits of Vercel's infrastructure, including:
- Fluid compute: Zero-configuration, optimized concurrency, dynamic scaling, background processing, automatic cold-start prevention, region failover, and more
- Active CPU pricing: Only pay for the CPU you use, not waiting for I/O (e.g. calling AI models, database queries)
- Instant Rollback: Quickly revert to a previous production deployment
- Vercel Firewall: A robust, multi-layered security system designed to protect your applications
- Preview deployments with Deployment Protection: Secure your preview environments and test changes safely before production
- Rolling releases: Gradually roll out backends to detect errors early
Use the backends reference architecture to choose a runtime, connect your backend to a frontend and agent tools, and plan background jobs.
Deploy the following backends to Vercel with zero-configuration.
To process background tasks with Python, you can deploy Celery or Dramatiq workers as queue-triggered Vercel Functions.
If you are transitioning from a fully managed server or containerized environment to Vercel’s serverless architecture, you may need to rethink a few concepts in your application since there is no longer a server always running in the background.
For platform-specific migration steps, choose the guide for your application:
- Python API: Migrate from Heroku, Render, or Railway.
- Docker app: Migrate from Railway, Fly.io, Render, Google Cloud Run, or AWS.
The following are generally applicable to serverless, and therefore Vercel Functions (running with or without Fluid compute).
Vercel Functions can serve WebSocket connections when Fluid compute is enabled. WebSocket connections follow Vercel Function limits, including maximum duration, so clients should handle reconnects when a connection closes.
Store persistent state, rooms, presence, and pub/sub coordination in an external data store instead of relying on in-memory state. Learn more in the WebSockets documentation.
To manage database connections efficiently, use the attachDatabasePool function from @vercel/functions.
Was this helpful?