api package

api.api_server module

api.api_server.run_api_server(host='localhost', port='5000', database_url='mongodb://localhost:27017')

Initializes a REST API endpoint that connects to the given database and serves data from it

Parameters
  • host – The host on which the API runs

  • port – The port on which the API runs

  • database_url – The url (with scheme) of the database from which the API serves data

Module contents

cortex.api is a submodule that is responsible for serving a REST API, which is consumed by cortex.cli and cortex.gui By default, it connects to a running MongoDB server, but can be easily extended to different databases

CLI

python -m cortex.api

python -m cortex.api [OPTIONS] COMMAND [ARGS]...

run-server

Runs the Cortex REST API server

python -m cortex.api run-server [OPTIONS]

Options

-h, --host <host>

The host of the REST API server

-p, --port <port>

The host of the REST API server

-d, --database <database>

The url (+scheme) of the database the API serves data from