Skip to content

Latest commit

 

History

History
50 lines (36 loc) · 1.72 KB

README.rst

File metadata and controls

50 lines (36 loc) · 1.72 KB

PATo API

Apache License

Source code https://github.com/DiamondLightSource/pato-backend

Particle Analysis and Tomography Data API.

Configuration

The API supports a configuration file, that follows the example set in config.json, but most importantly, two environment variables need to be set:

  • SQL_DATABASE_URL: The URL for the database
  • CONFIG_PATH: Path for the configuration file

Deployment

Running development server on your machine:

  1. Install the package with pip install . or pip install -e .
  2. Set the SQL_DATABASE_URL environment variable according to your database's location
  3. Run uvicorn with uvicorn pato.main:app --reload --port 8000

Testing

  • Build the database Docker image in database with podman build . -t diamond-ispyb
  • Run with podman run -p 3306:3306 --detach --name diamond-ispyb localhost/diamond-ispyb
    • You may change the port or where the container itself runs, just remember to update .test.env
  • Run pytest tests