This service is responsible for storing and querying maritime ports data.
Step 1. Run HTTP server:
make run-serveror run with docker-compose:
docker-compose up -dStep 2.: Click on http://0.0.0.0:8080/swagger/index.html to open Swagger UI.
Step 3.: Run following script to run some curl queries or just explore the API via Swagger UI:
./<project_root>/scripts/manual_api_test.shStep 0. Install pre-commit:
pip install pre-commit
# For macOS users.
brew install pre-commitThen run pre-commit install to setup git hook scripts.
Used hooks can be found here.
NOTE
pre-commitaids in running checks (end of file fixing, markdown linting, go linting, runs go tests, json validation, etc.) before you perform your git commits.
Step 1. Install external tooling (golangci-lint, swag etc.):
make installStep 2. Setup project for local testing (code lint, runs tests, builds all needed binaries):
make allNOTE
All binaries can be found in
<project_root>/bindirectory. Usemake cleanto delete old binaries.
Step 3. Run server:
make run-serverand open http://0.0.0.0:8080/swagger/index.html to open Swagger UI.
NOTE
Check Makefile for other useful commands.
NOTE
After modification of the API remember to run
make docsis order to re-generate the API documentation so that Swagger UI visualizes the up-to-date changes.
- Add more tests for negative scenarios.
- Introduce request and response logging and a
request_idorcorrelation_idproperty to allow for easy tracing. - Swap in-memory storage for a persistent storage type (RDBMS, Document Store, etc.).