David Taylor 2f6d6f0d54 Automatically mount provider’s engines at /chat-integration/{provider_name}
Provider controllers are automatically disabled when the provider is disabled (works the same way as plugin controllers)
2017-07-05 15:03:02 +01:00

24 lines
514 B
Ruby

module DiscourseChat::Provider::SlackProvider
class SlackCommandController < DiscourseChat::Provider::HookController
requires_provider ::DiscourseChat::Provider::SlackProvider::PROVIDER_NAME
def say_hello
render json: {hello: "world"}
end
end
class SlackEngine < ::Rails::Engine
engine_name DiscourseChat::PLUGIN_NAME+"-slack"
isolate_namespace DiscourseChat::Provider::SlackProvider
end
SlackEngine.routes.draw do
get "command" => "slack_command#say_hello"
end
end