Configuration
Copy the safe environment template. The real file is ignored by Git and must never be committed.
cp .env.example .env nano .env
The normal forecast works without an API key.
Met Office warnings
Configure the optional warning proxy with the endpoint and credential supplied by the Met Office Weather DataHub.
PORT=3000 MET_OFFICE_WARNINGS_URL=https://your-warnings-endpoint MET_OFFICE_API_KEY=your-rotated-api-key MET_OFFICE_AUTH_HEADER=X-API-Key
Restart the server after changing .env. Never put a private key in frontend code or GitHub Pages.
Example
Say if I had the API key for the weather warnings from the Weather warnings api docs. The configuration would look like this:
PORT=3000 MET_OFFICE_WARNINGS_URL=https://data.hub.api.metoffice.gov.uk/nswws/v1.1/objects/feed MET_OFFICE_API_KEY=YOUR_API_KEY MET_OFFICE_AUTH_HEADER=apikey
Remember to restart the server after changing .env. Your API key should remain private and never be committed to Git or exposed in frontend code.
Note
Some times you might need to edit server.js and app.js If you do find an issue And You resolve it, Make an issue and make a pull request on our github repository. You can find it here. Your changes should be well-documented and follow the project's contribution guidelines. Your contribution Are very Appreciated!