Conversation
|
While it could be interesting, this breaks the ability to simply install the few required gems manually and launch Lamer News by simply invoking "ruby app.rb", which makes it really easy even for Ruby neophytes to get involved. Maybe putting the API code in a separate file (could be "api.rb") and simply requiring it from the "app.rb" file could be a good compromise? |
|
Interesting. I will check. |
|
I think this is a great idea though, and it should probably be explored! Also, it could makes things easier to create Lamer News implementations in other languages. As far as I know, there is only one port currently, written in Perl : https://github.com/beanz/camelnews |
|
When using middlewares, it might make sense to use a middleware to connect to Redis, since that DB layer will be used both in the UI, and in the API part. I updated the PR, it's very experiment. However, both work: ruby app.rb rackup |
|
hope @antirez will merge this pull request soon. I want to have a clean way to integrate lamernews to my rails app |
|
Actually, I guess the PR is rather to be closed, since Lamernews and Rails On Wed, Sep 18, 2013 at 5:41 PM, huydx notifications@github.com wrote:
|
|
@mulderp Vagrant is completely based on "Rack-style" middleware, see here: https://github.com/mitchellh/vagrant/blob/master/plugins/providers/virtualbox/action.rb#L52-L78 |
|
great! thanks for the pointer! On Wed, Sep 18, 2013 at 6:11 PM, Mitchell Hashimoto <
|
Extracting the API into a Rack middleware might be interesting to combine Lamernews with other Rack applications, and/or to build a custom UI variation.
Glad to hear your feedback if this is interesting for you.
The Lamernews API would then be accessible from Rack with:
use Lamernews::API