Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
这是歌利亚的一个例子:
require 'goliath' class HelloWorld < Goliath::API def response(env) [200, {}, "hello world"] end end
定义类和子类化如何Goliath::API导致 Web 服务器启动?这不应该只是定义一个类,而不是实际实例化和执行一个吗?
Goliath::API
Goliath 使用at_exit,与 Sinatra、Minitest 等不同。
请参阅此处的一些相关代码,其中突出显示了此技巧有时需要的额外处理。