The weather API serves weather data for the conterminous United States.
- Node.js
The API is documented at https://weather.covercrop-data.org/
Prerequisites:
- You must be a member of the PSA team.
- Your IP address must be added to the Postgres database that's serving the weather data. Contact @rickhitchcock with that information.
- Node and NPM Download Here
- Git Download Here
- A code editor (we recommend VS Code) Download Here
Steps:
- Open a new Terminal for Mac/Linux or Command Prompt for Windows
- Move to the desired folder
cd /path/to/folder
- Clone this repository into that folder
git clone https://github.com/precision-sustainable-ag/weather-api
- From the Terminal/Command Prompt, move into the cloned directory
cd weather-api
- From the same command window, run
npm install
to install project dependencies. A full list of the dependencies can be found in package.json. If you are running on a windows machine, delete package-lock.json prior to running the below command. - Create a file called .env in src/shared. The file will contain the below keys. This document is in the git ignore, so it (and your API keys) won't be pushed to the repository. Ask @rickhitchcock for the values of the keys
Weather|postgres|<weather server key>
GoogleAPI||<google api key>
- After the dependencies have been installed and the .env file has been created, run
npm start
to run the code locally. - Open http://localhost.
Date Created: 08/15/2022
Date Last Modified: 06/08/2023