- Python - Required install
- Trivy - Required install
- Postman - Optional install
- Homebrew - Optional install - MacOS
- Understanding of Python - Required
This project uses the following packages to run it locally:
Run the following command to install dependencies required to run the API locally in your terminal/command prompt:
pip install -r requirements.txt
Once the dependencies are installed, to start the API locally you need to run:
uvicorn main:app --reload
This will start the API running locally on: http://127.0.0.1:8000
. uvicorn will direct you to another endpoint in your terminal/command prompt if something is currently using port 8000.
Congrats! The api is now running locally.
A good way to test it is working is to do a GET request using Postman on http://127.0.0.1:8000/container?name=node:18
. You will get a message indicating that you have not scanned a container named node:18 yet.
Depending on your machine, to stop the API running locally use the command for your machine to stop a running process in your terminal/command prompt where you ran uvicorn main:app --reload
.
To see the full API's functionality, and possible parameters and endpoints, just navigate to http://127.0.0.1:8000/docs
in a web browser while the app is running. This will dynamically update as new endpoints and functionality is added.