# Render Blueprint – deploy chat-backend as a Web Service
# https://render.com/docs/blueprint-spec
# Put this file at the root of the repo you connect to Render.
# If this app lives in a subfolder (e.g. chat-backend-main/), add: rootDir: chat-backend-main
services:
  - type: web
    name: soulsync-chat
    runtime: node
    region: oregon
    plan: free

    buildCommand: npm install && npm run build
    startCommand: npm start

    envVars:
      - key: NODE_ENV
        value: production
      - key: DATABASE_URL
        sync: false
    # In Render Dashboard → Environment, set DATABASE_URL (Postgres URL). Do NOT set VERCEL.

    healthCheckPath: /api/health
