Environment Variables
Create a .env file in news-server/ with the variables below before starting the server.
| Variable | Required | Format | Purpose |
|---|---|---|---|
PORT | Yes | Number | HTTP port for the Express server |
MONGODB_URI | Yes | MongoDB URI | Primary database connection string |
JWT_SECRET | Yes | Secret string | Signs and verifies JWT tokens |
API_KEY | Yes | Opaque token | Authenticates child-site API requests |
AWS_ACCESS_KEY_ID | For S3 | AWS key ID string | AWS auth for S3 signed URL generation |
AWS_SECRET_ACCESS_KEY | For S3 | AWS secret string | AWS auth for S3 signed URL generation |
AWS_REGION | For S3 | Region (e.g. eu-north-1) | S3 bucket region |
S3_BUCKET | For S3 | Bucket name string | Target S3 bucket for uploads |
S3_ENDPOINT | Optional | URL | Custom S3-compatible endpoint override |