Skip to content
This repository has been archived by the owner on May 5, 2023. It is now read-only.

ooni/api

Repository files navigation

OONI API

Source for https://api.ooni.io/

File bugs with the API inside of: https://github.com/ooni/backend/issues/new

Local development

You can run the OONI API locally in a development environment using docker and docker-compose. Follow the instructions below to set it up.

Quickstart

First you should build the docker image for the API:

make build

This only needs to be run once, or any time you make changes to the dependencies in the newapi/build_runnner.sh script.

To populate the database with some sample data (this is needed for running many of the tests), you should run:

make initdb

This also needs to only be run once.

At this point you have a fully setup development environment.

You can run the full test suite via:

make tests

If you care to only run a specific test, that can be done using the pytest -k option, passed in as a T env var to make:

T="-k test_my_test_name" make tests

If you want to run a local instance of the OONI API, this can be done via:

make serve