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

View File

@@ -6,7 +6,7 @@ const axios = require('axios');
const app = express();
const PORT = process.env.PORT || 3000;
const WEBHOOK_URL = "https://n8n.olehomelchenko.com/webhook/kse-research";
const WEBHOOK_URL = process.env.WEBHOOK_URL;
app.use(bodyParser.json());
app.use(express.static(path.join(__dirname, 'public')));