Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rkh/sinatra-more-server
Add more servers to Sinatra::Base#run! (part of BigBand).
https://github.com/rkh/sinatra-more-server
Last synced: 8 days ago
JSON representation
Add more servers to Sinatra::Base#run! (part of BigBand).
- Host: GitHub
- URL: https://github.com/rkh/sinatra-more-server
- Owner: rkh
- License: ncsa
- Created: 2010-02-12T15:26:47.000Z (almost 15 years ago)
- Default Branch: master
- Last Pushed: 2010-09-09T17:11:03.000Z (about 14 years ago)
- Last Synced: 2024-10-31T05:51:38.699Z (15 days ago)
- Language: Ruby
- Homepage:
- Size: 95.7 KB
- Stars: 9
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Sinatra::MoreServer
===================Adds support for more web servers to [Sinatra](http://sinatrarb.com)::Base#run!
Also, adds a helper method to ensure the server used from #run! supports async.callback, so all the
fancy comet implementations work.BigBand
-------Sinatra::MoreServer is part of the [BigBand](http://github.com/rkh/big_band) stack.
Check it out if you are looking for other fancy Sinatra extensions.Installation
------------gem install sinatra-more-server
Additional Servers
------------------Out of the box, Sinatra supports:
* [Webrick](http://www.ruby-doc.org/stdlib/libdoc/webrick/rdoc/)
* [Thin](http://code.macournoyer.com/thin/)
* [Mongrel](http://mongrel.rubyforge.org/)Currently, this extensions adds support for:
* [Unicorn](http://unicorn.bogomips.org/)
* [Rainbows!](http://rainbows.bogomips.org/)
* [Zbatery](http://zbatery.bogomip.org/)
* [Ebb](http://ebb.rubyforge.org/)Usage
-----Classic style:
require "sinatra"
require "sinatra/more_server"Or in your own subclass:
require "sinatra/base"
require "sinatra/more_server"
class Foo < Sinatra::Base
register Sinatra::MoreServer
endAsync only, please!
-------------------You use `async.callback`? Maybe via a library like [async\_sinatra](http://github.com/raggi/async_sinatra)
or [pusher](http://github.com/macournoyer/pusher)? Then you might want to make sure we only use a server
that supports it:require "sinatra"
require "sinatra/more_server"
configure do
has_async_callback!
endAs mentioned above, this will only have effect on running your script directly. However, in any other case,
you will choose your server manually, anyway. (Hint: As far as I know, only thin- and rainbows!-based implementations
support async.callback at the moment.)Thanks
------* Graham Hughes for fixing it to work with Rack >= 1.2