mirror of
https://github.com/bbernhard/signal-cli-rest-api.git
synced 2026-06-11 17:20:17 +00:00
1.8 KiB
1.8 KiB
Documentation
These files are generated using the swaggo/swag tool.
There are two steps, first generating the docs and then running the web server.
With docker compose (recommended)
- Build the docs
docker compose build - Serve the docs
docker compose up - Go to http://127.0.0.1:8080/swagger/index.html to view the docs
- If you get a Network error, replace the IP for the docker internal IP in the error, e.g: http://172.18.0.2:8080/swagger/index.html
Locally
Install go.
Generating the docs
- Set the current working dir to
srccd src - Run swag to generate the docs
- Option 1, via go
go run github.com/swaggo/swag/cmd/swag@v1.16.6 init --requiredByDefault --outputTypes "go,json" - Option 2, directly with swag
swag init --requiredByDefault --outputTypes "go,json" - Option 3, swag via docker
docker run --rm -v $(pwd):/code ghcr.io/swaggo/swag:latest init --requiredByDefault --outputTypes "go,json"
- Option 1, via go
- Set the current working dir to
src/docscd docs - Add the signal-cli receive V1 schemas
- Download the
signal-cli-x.y.z-json-schemas.tar.gzschema files from https://github.com/Gara-Dorta/signal-cli/releases - Extract the files
- Run the script to add the schemas
go run add_v1_receive_schemas.go ./path-to-signal-cli-json-schema-folder
- Download the
Run the web server
Run the web server to visualize the generated docs.
- Navigate to the
srcfoldercd src - Run the main script
go run main.go - Go to http://127.0.0.1:8080/swagger/index.html