Skip to content

Commit 4fdca4b

Browse files
committed
render
1 parent 98d5d0f commit 4fdca4b

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

‎DEPLOYMENT.md‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,15 @@ Railway provides a URL like: `https://your-app.up.railway.app`
9999

100100
1. New → PostgreSQL
101101
2. Name: `reprogramiq-db`
102-
3. Copy connection string
102+
3. Copy **Internal Database URL** (starts with `postgres://`)
103+
4. ⚠️ **Important**: Render requires SSL connections - this is already configured in `config/database.js`
103104

104105
### Environment Variables
105106

106107
Same as Railway, but use Render's database URL.
107108

109+
**Important**: Use the **Internal Database URL** for `DATABASE_URL` (not External).
110+
108111
## Option 3: Heroku
109112

110113
### Backend

‎backend/config/database.js‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@ const { Pool } = require('pg');
22
const logger = require('../utils/logger');
33

44
// Database connection pool
5-
// Use DATABASE_URL if provided (for CI/CD), otherwise use individual env vars
5+
// Use DATABASE_URL if provided (for production/CI/CD), otherwise use individual env vars
66
const pool = new Pool(
77
process.env.DATABASE_URL
88
? {
99
connectionString: process.env.DATABASE_URL,
10+
ssl: {
11+
rejectUnauthorized: false // Required for Render, Railway, Heroku, etc.
12+
},
1013
max: 20,
1114
idleTimeoutMillis: 30000,
1215
connectionTimeoutMillis: 2000,

0 commit comments

Comments
 (0)