Coming from #150 (comment), document how to add a RESTful API.
This monkey-patching should work:
module SlackRubyBotServer
module Api
module Endpoints
class MyEndpoint < Grape::API
get 'foobar' do
{ ok: true }
end
end
class RootEndpoint < Grape::API
mount MyEndpoint
end
end
end
end
We should document, and possibly implement a cleaner way to do this.
It's a bit of a rabbit hole. The root endpoint is https://github.com/slack-ruby/slack-ruby-bot-server/blob/master/lib/slack-ruby-bot-server/api/endpoints/root_endpoint.rb, invoked from
|
Endpoints::RootEndpoint.call(env) |
. It's extended in
https://github.com/slack-ruby/slack-ruby-bot-server-events/blob/fb68e18314a58f7d345f98e015243307b24c8f88/lib/slack-ruby-bot-server/api/endpoints.rb#L24 for events. The instance of that middleware (
) is started in
Coming from #150 (comment), document how to add a RESTful API.
This monkey-patching should work:
We should document, and possibly implement a cleaner way to do this.
It's a bit of a rabbit hole. The root endpoint is https://github.com/slack-ruby/slack-ruby-bot-server/blob/master/lib/slack-ruby-bot-server/api/endpoints/root_endpoint.rb, invoked from
slack-ruby-bot-server/lib/slack-ruby-bot-server/api/middleware.rb
Line 40 in 99e91ed
slack-ruby-bot-server/lib/slack-ruby-bot-server/api/middleware.rb
Line 15 in 99e91ed