Local testing/deployment
This documentation walks through how to deploy Headsign using pnpm.
- Install prerequisites:
# Install Node.js 24.x# See: https://nodejs.org/en/download/package-manager
# Install pnpmnpm install -g pnpm- Clone and setup:
git clone https://github.com/jasonad123/headsign.gitcd headsign
# Install dependenciespnpm install
# Create environment filecp .env.example .env# Edit .env with your API key- Build and run:
# Build SvelteKit appcd svelte-apppnpm installpnpm buildcd ..
# Start the serverpnpm start- Access: Navigate to
http://localhost:8080
For development with hot reload:
# Terminal 1: Start SvelteKit dev servercd svelte-app && pnpm dev
# Terminal 2: Start Express backendpnpm startThen access the app at http://localhost:5173 (Vite dev server with hot reload)
CORS Configuration (advanced)
Section titled “CORS Configuration (advanced)”Note: CORS is automatically disabled in production deployments. In production, SvelteKit and Express run on the same origin (port 8080), so cross-origin requests don’t occur and CORS headers are not needed.
CORS is only enabled during local development when running SvelteKit dev server (port 5173) separately from the Express backend (port 8080).
For development, the default allowed origin is http://localhost:5173. If you need to allow additional origins during development:
# Development only - allow SvelteKit dev serverALLOWED_ORIGINS=http://localhost:5173,http://localhost:8080Production deployments do not require ALLOWED_ORIGINS configuration. Each deployment is self-contained and serves both frontend and backend on the same origin.