Skip to content

aalavanthan18/kylin-api

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kylin-api

This API is set up for use with Python >= 3.7 and Docker. You can set-up your local environment manually or compose up with docker to launch a containerised version of the API.

Running locally

To run the server, you'll need to install a few requirements. To do this, run:

pip install -r requirements/common.txt

This will install only the dependencies required to run the server. To boot up the server, you can run:

bash bin/run.sh

This will start a Gunicorn server that wraps the Flask app defined in api/app.py.

You should now be able to send:

curl localhost:8080/health

And receive the response OK and status code 200.

Running with docker

Unsurprisingly, you'll need Docker installed to run this project with Docker. To launch a containerised version of the API, run:

docker compose up -d

Your server will boot up in a detached state as indicated by -d, and should be accessible as before. When you are ready to bring down your server, run:

docker compose down

Testing the API

Testing the API is set up using pytest. To execute tests you can install the project's development dependencies with:

pip install -r requirements/develop.txt

Then from the root directory, run:

pytest

This runs tests/test_api.py which contains test functions.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 92.9%
  • Makefile 4.0%
  • Dockerfile 2.4%
  • Shell 0.7%