Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

pedrogao/jerry

Repository files navigation

gin-rest-template

一个使用gin开发restful api应用的模板

代理

国内容易被墙,推荐设置proxy

export GOPROXY=https://goproxy.io

配置

使用viper读取和使用配置,环境变量的前缀的JERRY

运行

懒人版

./run.sh

详细版

先进行编译:

export GOPROXY=https://goproxy.io
go build -o jerry jerry.go

由于使用的是go module,在build的期间会默认下载需要的所有依赖,等待时间较长,耐心等待。

运行:

export JERRY_ADDR=:5000
 
export JERRY_RUNMODE=release
 
./jerry

TODO LIST

  • 全局异常处理
  • 参数检验
  • 多级路由,路由分层,路由前缀
  • JWT 支持
  • 日志记录
  • ORM 框架集成
  • 配置文件驱动
  • cors跨域
  • 测试驱动
  • 优化,美观

以高度封装带来的简单性,并不会带来真正的简单,只会带来更加的复杂

About

a template of restful api use gin

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

Contributors

AltStyle によって変換されたページ (->オリジナル) /