feat: centralize application configuration using environment variables and add dynamic CORS support

This commit is contained in:
2025-12-23 02:34:06 +01:00
parent e4f021a68f
commit 6c68d922dc
5 changed files with 106 additions and 59 deletions

14
notes-api/.env.example Normal file
View File

@@ -0,0 +1,14 @@
# Server Configuration
HOST=127.0.0.1
PORT=3000
# Database
DATABASE_URL=sqlite:data.db?mode=rwc
# Security
# Generate a secure random string for production (min 64 chars recommended)
SESSION_SECRET=k-notes-super-secret-key-must-be-at-least-64-bytes-long!!!!
# CORS
# Comma-separated list of allowed origins
CORS_ALLOWED_ORIGINS=http://localhost:5173