Code Monkey home page Code Monkey logo

inaturalistapi's Introduction

iNaturalistAPI

Build 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_ENV is required, so you'll need to set
# it here or elsewhere in your environment
NODE_ENV=development 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" ).

Running Tests with Docker

You can run the tests with Docker Compose. All required services will be started by the docker-compose.test.yml compose file:

docker compose -f docker-compose.test.yml up -d

You can follow the tests execution in the logs:

docker logs -f api-test

The first time you run the compose file, a local docker image for the API service will be automatically built, from you local GIT checkout. But if later you do some code changes, or update your GIT checkout, you need to re-build the docker image with:

docker compose -f docker-compose.test.yml build

This compose build is using the test target of the Dockerfile.

ESLint

Please run ESLint to check for syntax formatting errors. To run ESLint, run: npm run eslint. Please address any syntax errors before submitting pull requests. ESLint will also run automatically via Github Actions on submitted pull requests along with tests.

All test failures and syntax errors must be resolved before pull requests before will be merged.

Updating Documentation

Edit lib/views/swagger_v*.yml.ejs

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.