Comments (5)
So I had already figured out how to do it on my own prior to looking at this.
In essence all I did was modify config.ru to run SlackRubyBotServer alongside my Grape::API class...
run Rack::Cascade.new [SlackRubyBotServer::Api::Middleware.instance, MyApp::API]
from slack-ruby-bot-server.
It looks like the recommended way is to mount my Grape API in config/routes.rb for Rails 7. However, when I attempt to do that instead of the above it stops working. The only way I've been able to get both to successfully work together is the Cascade method above.
from slack-ruby-bot-server.
I like the Rack::Cascade
solution because it's clean and independent, but then it doesn't sit behind other stack items, it's a whole stack of its own (e.g. caching or Rack::Cors
). I think in the end the mot efficient solution is a single middleware stack where the bot API is mounted next to any other API. Would love to see 1) a proper extension point, 2) a working example added to the sample app, 3) documentation, and 4) a Rails sample/version.
from slack-ruby-bot-server.
Yeah, I'm at the point now where the Cascade isn't working so great. I'm trying to understand better what your monkey-patch above is doing.. to see if I can get it working in my app. Not sure I quite understand what it's doing quite yet though.
Thanks for the guidance so far!
from slack-ruby-bot-server.
I have been unsuccessful in getting your monkey-patch to work yet.
I tried adding the below to my config.ru. Which I thought was an equivalent to what you posted above.. but it continues to block other routes.
module SlackRubyBotServer
module Api
module Endpoints
class MyEndpoint < Grape::API
mount MyApp::API
end
class RootEndpoint < Grape::API
mount MyEndpoint
end
end
end
end
run SlackRubyBotServer::Api::Middleware.instance
from slack-ruby-bot-server.
Related Issues (20)
- Bot server analytics
- uninitialized constant SlackRubyBot (NameError) HOT 7
- How to integrate this lib with a Rails app? HOT 6
- Extract slack-ruby-bot-server-realtime HOT 1
- gem 'cursor_pagination' is conflicting with rails model generator HOT 2
- https://slack-ruby-bot-server.herokuapp.com no longer has a mongodb HOT 2
- oauth_authorization_url_mismatch for new slack apps HOT 5
- Migration guide for legacy Slack apps to Granular Scopes
- Unable to use Postgres HOT 5
- NameError: uninitialized constant SlackRubyBotServer::Api::Presenters::TeamPresenter::Boolean w/mongoid 7.3.x HOT 5
- Throws a Runtime Error if team is already regstered. HOT 6
- Add support for socket mode HOT 4
- Replace cursor_pagination HOT 12
- Add to Slack button - Redirect Endpoint? HOT 1
- What about this gem sets it up to show the Add To Slack button? HOT 3
- Bot doesn't handle being removed from the last Organization on Slack side HOT 2
- Is there anyway to extend the Team model to add my own attributes? HOT 11
- Prevent test workflows from running when updating docs only HOT 1
- Release 2.1.0 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from slack-ruby-bot-server.