SWAG doc not working

Viewed 165

Hi I'm tring to find the documentation of backend, and I noticed that the project is using swag.
I ran both the code below and

swag init --generalInfo ./cmd/answer/main.go

and ./gen-api.sh

I also saw the doc go fiel in docs folder, but the API page is not loading (jumps to http://localhost:8080/50x ) in http://localhost:8080/swagger/index.html after I ran the docker with

docker run -d -p 8080:80 -v answer-data:/data --name answer answerdev/answer:latest

Any idea about how to generate the API? Thanks!

1 Answers

ok i figured it out, you need to set up the db and the API will show after that