https://github.com/intridea/grape
有没有办法为应用程序自动生成模板,该模板将使用葡萄提供类似 REST 的接口。我正在寻找像“rails new app”这样的东西,它将为我提供构建的框架。如果不是我应该使用什么?
https://github.com/intridea/grape
有没有办法为应用程序自动生成模板,该模板将使用葡萄提供类似 REST 的接口。我正在寻找像“rails new app”这样的东西,它将为我提供构建的框架。如果不是我应该使用什么?
Not that I know of, but there are several example apps with different stacks and functionality on their wiki.
You can mix and match from what you see there, or just clone one of them to get started.
Also, Grape's DSL itself will guide you towards REST. You declare resources and then use the http verbs to define the requests.
葡萄起动器似乎是你要找的。
安装 gem( gem install grape-starter
) 并使用grape-starter new awesome_api
.
如需更多选项,例如选择 ORM 或设置前缀,请使用grape-starter -h
. 我建议看一下 README。