To get started with the project, follow these steps to clone the repository to your local directory:
-
Open your terminal.
-
Navigate to the directory where you want to clone the repository.
-
Run the following command:
git clone https://github.com/DeLion13/granium_test.git- Once the cloning process is complete, you will have a local copy of the repository in your chosen directory.
Ensure that the Docker daemon is running on your system.
Navigate into the cloned repository directory:
cd granium_testBuild the Docker image using the following command:
docker build -t granium .Run the Docker container using the following command:
docker run -p 8080:8080 graniumOnce the container is running, test the application by sending a GET request to the /api/v1/ltp endpoint:
curl http://localhost:8080/api/v1/ltp | jqThis command sends a GET request to the specified endpoint and pipes the output to jq for pretty printing.
Expected behaviour is:
{
"ltp": [
{
"pair": "BTC/USD",
"amount": "67109.70000"
},
{
"pair": "BTC/EUR",
"amount": "62693.90000"
},
{
"pair": "BTC/CHF",
"amount": "60900.00000"
}
]
}To run tests on your local environment feel free to use this command:
cargo test --package granium --bin granium --all-features -- test::test --show-output