@@ -17,15 +17,11 @@ Redis is optional. When the API starts requests for all columns and all units
1717are cached. If Redis is available it will be used, otherwise they are cached in
1818the application memory.
1919
20- The API requires ` node ` v14 or later to run. Recent testing has been conducted
21- on ` node ` v18.
20+ The API requires ` node ` v20 or to run.
2221
23- #### Data
22+ ## Data
2423
25- The following databases must be in place:
26-
27- - MariaDB - macrostrat
28- - Postgres - burwell, alice, wof, elevation
24+ The ` macrostrat ` PostgreSQL database must be available.
2925
3026## Setup
3127
@@ -42,12 +38,6 @@ Next, install dependencies:
4238yarn install
4339```
4440
45- NOTE: Postgres connections are completely broken in node v14 and v15 (as of
46- 2021-03-16). Use node v12!
47-
48- This will also run the script ` postinstall.sh ` which copies credentials files
49- into place.
50-
5141## Running the API
5242
5343Add environment variables to your shell or ` .env ` file. The
@@ -56,6 +46,17 @@ Add environment variables to your shell or `.env` file. The
5646To start the API run ` npm start <port|5000> ` . This will start the API on the
5747specified port (default 5000).
5848
49+ ## Running tests
50+
51+ Tests can be run with ` yarn test ` . Currently, you must have a local instance of the
52+ API running separately (e.g., ` yarn start ` or ` yarn run dev ` ). You can also set
53+ the ` TEST_API_URL ` variable to a different URL if you want to test a
54+ different instance.
55+
56+ Additionally, you can set a ` TEST_PRODUCTION_API_URL ` to run comparisons against
57+ another running instance of the API (e.g., production). This is useful for
58+ ensuring that new versions of the API return the same results as older versions.
59+
5960## Generating a release
6061
6162Update the version string in ` package.json ` and run:
@@ -74,6 +75,13 @@ instructions for generating a cache refresh key. The cache refresh key is used
7475as a secret parameter to programmatically refresh the column cache, such as in
7576situations in which the underlying data has been changed (editing, adding, etc).
7677
78+ ## Data
79+
80+ Required databases (version 1):
81+
82+ - MariaDB - macrostrat
83+ - Postgres - burwell, alice, wof, elevation
84+
7785## Running
7886
7987To start the API simply run ` npm start ` which will start a process on port 5050.
0 commit comments