【文件属性】:
文件名称:golang-echo:Golang回声
文件大小:12KB
文件格式:ZIP
更新时间:2021-02-09 14:11:31
Go
使用Mux,Gorm和MySQL的Golang示例代码库
安装步骤:
克隆此存储库
创建数据库golang_mvc
运行应用程序和数据库迁移, go run main.go
API端点:
创建用户http://localhost:5000/users
显示用户http://localhost:5000/users
显示单个用户http://localhost:5000/users/{id}
更新用户http://localhost:5000/users/{id}
删除用户http://localhost:5000/users/{id}
运行单元测试:
模型测试:
cd tests/modeltests
go test -v
【文件预览】:
golang-echo-main
----go.mod(292B)
----.env(347B)
----main.go(90B)
----go.sum(4KB)
----src()
--------utils()
--------models()
--------controllers()
--------responses()
--------server.go(453B)
----README.md(523B)
----tests()
--------modeltests()
----.gitignore(197B)