···27272828# End of https://www.toptal.com/developers/gitignore/api/go
29293030-*.hurl
3030+.direnv/
+17-3
README.org
···7788- [[https://hurl.dev][hurl]] :: CLI tool that runs http requests, similar to curl
99- [[https://docs.docker.com/desktop/][docker :: ]] Using docker to run project and mocks
1010+- [[https://just.systems/][just]] :: CLI runner
1011- [[https://jqlang.org/][jq]] :: (Optional) CLI tool to query JSON data
1212+1313+If you're using nix, you can find a flake in the root of the project and run =nix develop= to download all the tools (or allow [[https://direnv.net/][direnv]] to auto import in your path)
11141215*** Usage
13161414-Run the project with both providers mocked:
1717+Run docker compose to start mocks, the mocks will use ports =8002= and =8003= and the were created using [[https://github.com/mrak/stubby4node][stubby4node]]
15181619#+begin_src shell
1720docker compose up
1821#+end_src
19222020-The docker compose file is configured to build and run 3 dockers, 2 being the mocked providers (Stripe and Braintree), they're both were created using [[https://github.com/mrak/stubby4node][stubby4node]] and the project.
2121-The main project will use port =8000= in your machine and the providers will use port =8001= and =8002= (this is mostly for running the main project outside docker).
2323+In another terminal, bulid and run the project with =just=, it will start the project in port =8000=
2424+2525+#+begin_src shell
2626+just run
2727+#+end_src
22282329In other terminal, make the request with hurl
2430···3137#+begin_src shell
3238hurl request.hurl | jq .
3339#+end_src
4040+4141+** Tests
4242+4343+To run all tests, you can run the command that it will run all tests from the project:
4444+4545+#+begin_src shell
4646+just test
4747+#+end_src