Refactor webhook URL configuration to use environment variable

- Updated questionnaire.js to use a local API endpoint as a fallback for the webhook URL.
- Modified server.js to retrieve the webhook URL from an environment variable.
- Added .env.example file to provide a template for environment configuration, including the optional webhook URL.
- Added an empty responses.json for local storage
This commit is contained in:
2025-09-07 22:04:51 +03:00
parent f4f5c54596
commit d0b14ba664
6 changed files with 495 additions and 169 deletions

15
.env.example Normal file
View File

@@ -0,0 +1,15 @@
# Environment configuration for the research application
# Port for the web server (optional, defaults to 3000)
PORT=3000
# External webhook URL for data collection (optional)
# If not set, data will only be stored locally in data/responses.json
# Example: WEBHOOK_URL=https://your-domain.com/webhook/endpoint
WEBHOOK_URL=
# Docker/Traefik configuration (for production deployment)
YOUR_DOMAIN=your-domain.com
LETSENCRYPT_EMAIL=your-email@example.com
TRAEFIK_BASIC_AUTH_USER=admin
TRAEFIK_BASIC_AUTH_PASSWORD=your-hashed-password