/iNaturalistAPI

Node.js API for iNaturalist.org

Primary LanguageJavaScript

iNaturalistAPI

Build Status Coverage Status

Our API is documented using the Swagger/OpenAPI 2.0 specification. Check out the Swagger UI documentation viewer at https://api.inaturalist.org/docs.

Setup

npm install
# Fill in vals to connect to Rails, Postgres, and elasticsearch
cp config_example.js config.js
# Run the node app on port 4000
node app.js

Running Tests

If running iNaturalist services from Docker, make sure to run make services from the main app first (note that Elasticsearch may take a few seconds to start).

Run all: npm test Filter by pattern: NODE_ENV=test ./node_modules/mocha/bin/_mocha --recursive --fgrep observations

You can also add .only to a describe or it call to only run that test when you run npm test, e.g. it.only( "should only run this test" ).

Updating Documentation

Edit lib/views/swagger_v*.yml.ejs