Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

swagger入门 #20

Open
xpzouying opened this issue Oct 29, 2020 · 1 comment
Open

swagger入门 #20

xpzouying opened this issue Oct 29, 2020 · 1 comment
Labels

Comments

@xpzouying
Copy link
Owner

对Golang http server增加swagger文档。

@xpzouying
Copy link
Owner Author

对Golang http server增加swagger文档。

使用最常见的http router之一gin来启动http server的demo,

  1. 生成HTTP文档:
    # 编写对应的http处理函数,增加对应的注释后,运行下列命令生成文档
    swag init
  2. 运行程序:
    go run .
  3. 打开swagger API接口文档:http://localhost:8080/swagger/index.html
    image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant