JSON-API 框架:GIN
jopen
11年前
Gin 是一个 JSON-API 框架,目前还处于早期开发状态。
当你需要在性能和伸缩性要求很高时,Gin 对你会很有帮助。它运行于 OpenResty ,使用 Lua 编写。
特性:
- API Versioning embedded in the framework
- Routes with named and pattern routes support
- Controllers
- Models and a MySql ORM
- Migrations for SQL engines
- Test helpers and wrappers
- Simple error raising and definition
- Support for multiple databases in your application
- An embedded API Console to play with your API
- A client to create, start and stop your applications
下面是一个简单的 Gin 控制器:
local InfoController = {} function InfoController:whoami() return 200, { name = 'gin' } end return InfoController