freightdesk/webapp/src/services/supabase.js
FreightDesk ec6ec234ac
Some checks are pending
FreightDesk CI/CD / Lint & Test (push) Waiting to run
FreightDesk CI/CD / Build Docker Image (push) Blocked by required conditions
FreightDesk CI/CD / Deploy to Coolify (push) Blocked by required conditions
[OWL] Critical fixes: registration routes, duplicate payments mount, missing views
Critical Fixes:
- Registration routes: changed /shipper → /register/shipper, /driver → /register/driver
  (was causing 404s — landing page linked to /register/* but routes were /shipper and /driver)
- Registration form actions: fixed to match /register/shipper and /register/driver
- Removed duplicate /payments route mount in server.js (payments.js is escrow, mounted at /escrow)
- Supabase client: now uses service key (falls back to anon key)
- Created missing pages/errors/403.ejs view

Documentation:
- README.md: full project documentation
- .env.example: environment variable template
- .dockerignore: exclude dev files from Docker image
2026-06-08 02:27:28 +00:00

14 lines
440 B
JavaScript

const { createClient } = require('@supabase/supabase-js');
const config = require('../config/env');
const supabaseUrl = config.supabase.url;
const supabaseKey = config.supabase.serviceKey || config.supabase.key;
if (!supabaseUrl || !supabaseKey) {
console.error('Missing SUPABASE_URL or SUPABASE_SERVICE_KEY. Check .env file.');
process.exit(1);
}
const supabase = createClient(supabaseUrl, supabaseKey);
module.exports = supabase;