Deploy Serverless to Vercel
- You need a production Postgres database. It’s straightforward to set this up on Digital Ocean.
- You also need a connection pool. This is also relatively straightforward to set up on Digital Ocean.
- You need your entire database connection string. If you need, read the Prisma docs on this.
- Make sure you get the connection string to your connection pool, not directly to the DB.
- If using pgBouncer (default connection pool on Digital Ocean), you must add
&pgbouncer=true
to the end of your connection string for Prisma to work correctly.
- Add your DB url as a secret environment variable or by running
vercel env add DATABASE_URL
- Add your environment variable (It needs to be 32 characters long)
- Run
git push
if using the Git Integration or if using Vercel CLI