mirror of
https://github.com/bbernhard/signal-cli-rest-api.git
synced 2026-07-11 22:20:49 +00:00
1.5 KiB
1.5 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.
Generating the docs
Regenerate the files with your local source code changes.
- Set the current working dir to
srccd src - Run swag to generate the docs
- Option 1, via docker
docker run --rm -v $(pwd):/code ghcr.io/swaggo/swag:latest init --requiredByDefault --outputTypes "go,json" - Option 2, install swag and run the command line tool
swag init --requiredByDefault --outputTypes "go,json"
- Option 1, via docker
- Set the current working dir to
src/docscd docs - Run the script to add the receive V1 schemas
go run add_v1_receive_schemas.go
Run the web server
Run the web server to visualize the generated docs.
- Run the main script
- Option 1, via docker, run the command at the root of the repository
docker compose up - Option 2, install go and run the command line tool
cd srcgo run main.go
- Option 1, via docker, run the command at the root of the repository
Navigate to the docs
The docs are served at: http://127.0.0.1:8080/swagger/index.html
When serving with docker, 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