Gump
安装Installation
在Gemfile中添加
Add this line to your application's Gemfile:
gem 'gump'
然后执行
And then execute:
$ bundle install
或者,你可以手动安装
Or install it yourself as:
$ gem install gump
使用Use
配置方式
只需以API
开始注释,以DESC
、PARAMS
、RETURN
、GET
、POST
等标记注释行即可。
先创建一个待测试的项目,文件bigsword.ru
require "bigsword"
get "/hello/:name" do
"hello Gump! I'm #{params[:name]}"
end
post "/haha/:name" do
"haha Gump! I'm #{params[:name]},and this is post"
end
run Proc.new { |env| _call env }
先把这个项目跑起来
$ rackup bigsword.ru
再启动gump服务
由于我们使用到了puma
来启动ruby服务,所以需要要gemfile里面添加gem "puma"
。
$ gump start
License
See the LICENSE.