Integrate dotenv for environment variable management and enhance form error handling

- Added dotenv to load environment variables from a .env file in server.js for better configuration management.
- Improved the Form component by refining error handling during form submission, including specific messages for different error scenarios.
- Updated the CSRF token handling and ensured proper validation of response types from the contact API.
- Enhanced user feedback by providing clearer messages for success and error states in the form submission process.
This commit is contained in:
2025-11-02 02:06:29 +01:00
parent 8773788335
commit 3b28d1c52d
4 changed files with 129 additions and 32 deletions

View File

@@ -1,3 +1,7 @@
// Load environment variables from .env file first
import dotenv from 'dotenv';
dotenv.config();
import express from 'express';
import compression from 'compression';
import { handler } from './dist/server/entry.mjs';