Configuration
Configure Spry and SQLPage for your project
SQLPage Configuration
Section titled “SQLPage Configuration”Configure SQLPage in sqlpage/sqlpage.json:
{ "database_url": "sqlite://app.db", "port": 8080, "site_title": "My Spry Application", "site_prefix": "", "max_uploaded_file_size": 10485760, "environment": "development"}Configuration Options
Section titled “Configuration Options”database_url
Section titled “database_url”Connection string for your database (SQLite or PostgreSQL)
"database_url": "postgresql://user:pass@localhost:5432/db"Port number for the SQLPage server (default: 8080)
site_title
Section titled “site_title”Default title for your application pages
site_prefix
Section titled “site_prefix”URL prefix for all routes (useful for subdirectory deployments)
Environment Variables
Section titled “Environment Variables”Configure Spry using environment variables:
# Database connectionexport DATABASE_URL="postgresql://localhost:5432/mydb"
# SQLPage configurationexport SQLPAGE_PORT=8080export SQLPAGE_SITE_PREFIX=""
# Spry behaviorexport SPRY_WATCH_INTERVAL=500export SPRY_LOG_LEVEL="info"Project Structure
Section titled “Project Structure”Recommended directory structure for Spry projects:
project/├── Spryfile.md # Main executable markdown├── spry.ts # Spry CLI script├── sqlpage/│ ├── sqlpage.json # SQLPage config (dev)│ ├── sqlpage.prod.json # Production config│ └── migrations/ # Database migrations├── dev-src.auto/ # Generated SQLPage files (dev)├── dist/ # Production build output├── scripts/ # Additional scripts└── data/ # Data files and seedsMultiple Configurations
Section titled “Multiple Configurations”Use different configurations for different environments:
Development
Section titled “Development”./spry.ts spc --fs dev-src.auto --conf sqlpage/sqlpage.json --watchProduction
Section titled “Production”./spry.ts spc --fs dist --conf sqlpage/sqlpage.prod.json