AlkantarClanX12
Current Path : /opt/alt/ruby26/lib64/ruby/gems/2.6.0/doc/rack-3.0.8/ri/ |
Current File : //opt/alt/ruby26/lib64/ruby/gems/2.6.0/doc/rack-3.0.8/ri/page-README_md.ri |
U:RDoc::TopLevel[ i I"README.md:ETcRDoc::Parser::Markdowno:RDoc::Markup::Document:@parts[OS:RDoc::Markup::Heading: leveli: textI"!rdoc-image:contrib/logo.webp;To:RDoc::Markup::BlockQuote;[o:RDoc::Markup::Paragraph;[I"<b><em>NOTE:</em></b> Rack v3.0.0 was recently released. Please check the {Upgrade Guide}[UPGRADE-GUIDE.md] for more details about migrating your existing servers, middlewares and applications. For detailed information on specific changes, check the {Change Log}[CHANGELOG.md].;To; ;[I"Rack provides a minimal, modular, and adaptable interface for developing web applications in Ruby. By wrapping HTTP requests and responses in the simplest way possible, it unifies and distills the bridge between web servers, web frameworks, and web application into a single method call.;To; ;[I"~The exact details of this are described in the {Rack Specification}[SPEC.rdoc], which all Rack applications should conform to.;TS; ; i;I"Installation;To; ;[I"�Add the rack gem to your application bundle, or follow the instructions provided by a {supported web framework}[#supported-web-frameworks]:;To:RDoc::Markup::Verbatim;[I"�# Install it generally: $ gem install rack --pre # or, add it to your current application gemfile: $ bundle add rack --version 3.0.0 ;T:@format: basho; ;[I"vIf you need features from <code>Rack::Session</code> or <code>bin/rackup</code> please add those gems separately.;To;;[I"'$ gem install rack-session rackup ;T;;S; ; i;I" Usage;To; ;[I"MCreate a file called <code>config.ru</code> with the following contents:;To;;[I"3run do |env| [200, {}, ["Hello World"]] end ;T;: rubyo; ;[I"]Run this using the rackup gem or another {supported web server}[#supported-web-servers].;To;;[I"L$ gem install rackup $ rackup $ curl http://localhost:9292 Hello World ;T;;S; ; i;I"Supported web servers;To; ;[I"=Rack is supported by a wide range of servers, including:;To:RDoc::Markup::List: @type:BULLET:@items[o:RDoc::Markup::ListItem:@label0;[o; ;[I",{Agoo}[https://github.com/ohler55/agoo];To;;0;[o; ;[I"L{Falcon}[https://github.com/socketry/falcon] <b>(Rack 3 Compatible)</b>;To;;0;[o; ;[I"2{Iodine}[https://github.com/boazsegev/iodine];To;;0;[o; ;[I"*{NGINX Unit}[https://unit.nginx.org/];To;;0;[o; ;[I"i{Phusion Passenger}[https://www.phusionpassenger.com/] (which is mod_rack for Apache and for nginx);To;;0;[o; ;[I"{Puma}[https://puma.io/];To;;0;[o; ;[I"0{Thin}[https://github.com/macournoyer/thin];To;;0;[o; ;[I"){Unicorn}[https://yhbt.net/unicorn/];To;;0;[o; ;[I":{uWSGI}[https://uwsgi-docs.readthedocs.io/en/latest/];To;;0;[o; ;[I">{Lamby}[https://lamby.custominktech.com] (for AWS Lambda);To; ;[I"�You will need to consult the server documentation to find out what features and limitations they may have. In general, any valid Rack app will run the same on all these servers, without changing anything.;TS; ; i;I"Rackup;To; ;[I"�Rack provides a separate gem, {rackup}[https://github.com/rack/rackup] which is a generic interface for running a Rack application on supported servers, which include <code>WEBRick</code>, <code>Puma</code>, <code>Falcon</code> and others.;TS; ; i;I"Supported web frameworks;To; ;[I"RThese frameworks and many others support the {Rack Specification}[SPEC.rdoc]:;To;;;;[ o;;0;[o; ;[I"2{Camping}[https://github.com/camping/camping];To;;0;[o; ;[I"${Hanami}[https://hanamirb.org/];To;;0;[o; ;[I"&{Padrino}[https://padrinorb.com/];To;;0;[o; ;[I"K{Roda}[https://github.com/jeremyevans/roda] <b>(Rack 3 Compatible)</b>;To;;0;[o; ;[I".{Ruby on Rails}[https://rubyonrails.org/];To;;0;[o; ;[I"&{Sinatra}[https://sinatrarb.com/];To;;0;[o; ;[I"L{Utopia}[https://github.com/socketry/utopia] <b>(Rack 3 Compatible)</b>;To;;0;[o; ;[I".{WABuR}[https://github.com/ohler55/wabur];TS; ; i;I"0Older (possibly unsupported) web frameworks;To;;;;[o;;0;[o; ;[I"!{Ramaze}[http://ramaze.net/];To;;0;[o; ;[I"1{Rum}[https://github.com/leahneukirchen/rum];TS; ; i;I"+Available middleware shipped with Rack;To; ;[I"�Between the server and the framework, Rack can be customized to your applications needs using middleware. Rack itself ships with the following middleware:;To;;;;[o;;0;[o; ;[I"H<code>Rack::CommonLogger</code> for creating Apache-style logfiles.;To;;0;[o; ;[I"�<code>Rack::ConditionalGet</code> for returning {Not Modified}[https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/304] responses when the response has not changed.;To;;0;[o; ;[I"[<code>Rack::Config</code> for modifying the environment before processing the request.;To;;0;[o; ;[I"k<code>Rack::ContentLength</code> for setting a <code>content-length</code> header based on body size.;To;;0;[o; ;[I"i<code>Rack::ContentType</code> for setting a default <code>content-type</code> header for responses.;To;;0;[o; ;[I"E<code>Rack::Deflater</code> for compressing responses with gzip.;To;;0;[o; ;[I"a<code>Rack::ETag</code> for setting <code>etag</code> header on bodies that can be buffered.;To;;0;[o; ;[I"r<code>Rack::Events</code> for providing easy hooks when a request is received and when the response is sent.;To;;0;[o; ;[I"7<code>Rack::Files</code> for serving static files.;To;;0;[o; ;[I"K<code>Rack::Head</code> for returning an empty body for HEAD requests.;To;;0;[o; ;[I"]<code>Rack::Lint</code> for checking conformance to the {Rack Specification}[SPEC.rdoc].;To;;0;[o; ;[I"D<code>Rack::Lock</code> for serializing requests using a mutex.;To;;0;[o; ;[I"M<code>Rack::Logger</code> for setting a logger to handle logging errors.;To;;0;[o; ;[I"h<code>Rack::MethodOverride</code> for modifying the request method based on a submitted parameter.;To;;0;[o; ;[I"|<code>Rack::Recursive</code> for including data from other paths in the application, and for performing internal redirects.;To;;0;[o; ;[I"P<code>Rack::Reloader</code> for reloading files if they have been modified.;To;;0;[o; ;[I"l<code>Rack::Runtime</code> for including a response header with the time taken to process the request.;To;;0;[o; ;[I"y<code>Rack::Sendfile</code> for working with web servers that can use optimized file serving for file system paths.;To;;0;[o; ;[I"�<code>Rack::ShowException</code> for catching unhandled exceptions and presenting them in a nice and helpful way with clickable backtrace.;To;;0;[o; ;[I"`<code>Rack::ShowStatus</code> for using nice error pages for empty client error responses.;To;;0;[o; ;[I"M<code>Rack::Static</code> for more configurable serving of static files.;To;;0;[o; ;[I"^<code>Rack::TempfileReaper</code> for removing temporary files creating during a request.;To; ;[I"�All these components use the same interface, which is described in detail in the {Rack Specification}[SPEC.rdoc]. These optional components can be used in any way you wish.;TS; ; i;I"Convenience interfaces;To; ;[I"�If you want to develop outside of existing frameworks, implement your own ones, or develop middleware, Rack provides many helpers to create Rack applications quickly and without doing the same web stuff all over:;To;;;;[o;;0;[o; ;[I"a<code>Rack::Request</code> which also provides query string parsing and multipart handling.;To;;0;[o; ;[I"`<code>Rack::Response</code> for convenient generation of HTTP replies and cookie handling.;To;;0;[o; ;[I"�<code>Rack::MockRequest</code> and <code>Rack::MockResponse</code> for efficient and quick testing of Rack application without real HTTP round-trips.;To;;0;[o; ;[I"�<code>Rack::Cascade</code> for trying additional Rack applications if an application returns a not found or method not supported response.;To;;0;[o; ;[I"e<code>Rack::Directory</code> for serving files under a given directory, with directory indexes.;To;;0;[o; ;[I"C<code>Rack::MediaType</code> for parsing content-type headers.;To;;0;[o; ;[I"R<code>Rack::Mime</code> for determining content-type based on file extension.;To;;0;[o; ;[I"l<code>Rack::RewindableInput</code> for making any IO object rewindable, using a temporary file buffer.;To;;0;[o; ;[I"Y<code>Rack::URLMap</code> to route to multiple applications inside the same process.;TS; ; i;I"Configuration;To; ;[I"eRack exposes several configuration parameters to control various features of the implementation.;TS; ; i;I"#<code>param_depth_limit</code>;To;;[I"2Rack::Utils.param_depth_limit = 32 # default ;T;;o; ;[I"wThe maximum amount of nesting allowed in parameters. For example, if set to 3, this query string would be allowed:;To;;[I"?a[b][c]=d ;T;0o; ;[I"0but this query string would not be allowed:;To;;[I"?a[b][c][d]=e ;T;0o; ;[I"SLimiting the depth prevents a possible stack overflow when parsing parameters.;TS; ; i;I"&<code>multipart_file_limit</code>;To;;[I"6Rack::Utils.multipart_file_limit = 128 # default ;T;;o; ;[I"�The maximum number of parts with a filename a request can contain. Accepting too many parts can lead to the server running out of file handles.;To; ;[I"{The default is 128, which means that a single request can't upload more than 128 files at once. Set to 0 for no limit.;To; ;[I"YCan also be set via the <code>RACK_MULTIPART_FILE_LIMIT</code> environment variable.;To; ;[I"}(This is also aliased as <code>multipart_part_limit</code> and <code>RACK_MULTIPART_PART_LIMIT</code> for compatibility);TS; ; i;I",<code>multipart_total_part_limit</code>;To; ;[I"wThe maximum total number of parts a request can contain of any type, including both file and non-file form fields.;To; ;[I"_The default is 4096, which means that a single request can't contain more than 4096 parts.;To; ;[I"Set to 0 for no limit.;To; ;[I"_Can also be set via the <code>RACK_MULTIPART_TOTAL_PART_LIMIT</code> environment variable.;TS; ; i;I"Changelog;To; ;[I"&See {CHANGELOG.md}[CHANGELOG.md].;TS; ; i;I"Contributing;To; ;[I"jSee {CONTRIBUTING.md}[CONTRIBUTING.md] for specific details about how to make a contribution to Rack.;To; ;[I"gPlease post bugs, suggestions and patches to {GitHub Issues}[https://github.com/rack/rack/issues].;To; ;[I"UPlease check our {Security Policy}[https://github.com/rack/rack/security/policy] for responsible disclosure and security bug reporting process. Due to wide usage of the library, it is strongly preferred that we manage timing in order to provide viable patches at the time of disclosure. Your assistance in this matter is greatly appreciated.;TS; ; i;I" See Also;TS; ; i;I"<code>rack-contrib</code>;To; ;[I"�The plethora of useful middleware created the need for a project that collects fresh Rack middleware. <code>rack-contrib</code> includes a variety of add-on components for Rack and it is easy to contribute new modules.;To;;;;[o;;0;[o; ;[I")https://github.com/rack/rack-contrib;TS; ; i;I"<code>rack-session</code>;To; ;[I"5Provides convenient session management for Rack.;To;;;;[o;;0;[o; ;[I")https://github.com/rack/rack-session;TS; ; i;I"Thanks;To; ;[I"&The Rack Core Team, consisting of;To;;;;[o;;0;[o; ;[I"@Aaron Patterson {tenderlove}[https://github.com/tenderlove];To;;0;[o; ;[I"<Samuel Williams {ioquatix}[https://github.com/ioquatix];To;;0;[o; ;[I"?Jeremy Evans {jeremyevans}[https://github.com/jeremyevans];To;;0;[o; ;[I"CEileen Uchitelle {eileencodes}[https://github.com/eileencodes];To;;0;[o; ;[I";Matthew Draper {matthewd}[https://github.com/matthewd];To;;0;[o; ;[I"CRafael França {rafaelfranca}[https://github.com/rafaelfranca];To; ;[I"and the Rack Alumni;To;;;;[o;;0;[o; ;[I"9Ryan Tomayko {rtomayko}[https://github.com/rtomayko];To;;0;[o; ;[I">Scytrin dai Kinthra {scytrin}[https://github.com/scytrin];To;;0;[o; ;[I"HLeah Neukirchen {leahneukirchen}[https://github.com/leahneukirchen];To;;0;[o; ;[I"3James Tucker {raggi}[https://github.com/raggi];To;;0;[o; ;[I".Josh Peek {josh}[https://github.com/josh];To;;0;[o; ;[I":José Valim {josevalim}[https://github.com/josevalim];To;;0;[o; ;[I"<Michael Fellinger {manveru}[https://github.com/manveru];To;;0;[o; ;[I"CSantiago Pastorino {spastorino}[https://github.com/spastorino];To;;0;[o; ;[I"3Konstantin Haase {rkh}[https://github.com/rkh];To; ;[I"would like to thank:;To;;;;[o;;0;[o; ;[I".Adrian Madrid, for the LiteSpeed handler.;To;;0;[o; ;[I"VChristoffer Sawicki, for the first Rails adapter and <code>Rack::Deflater</code>.;To;;0;[o; ;[I"4Tim Fletcher, for the HTTP authentication code.;To;;0;[o; ;[I"PLuc Heinrich for the Cookie sessions, the static file handler and bugfixes.;To;;0;[o; ;[I"0Armin Ronacher, for the logo and racktools.;To;;0;[o; ;[I"Alex Beregszaszi, Alexander Kahn, Anil Wadghule, Aredridel, Ben Alpert, Dan Kubb, Daniel Roethlisberger, Matt Todd, Tom Robinson, Phil Hagelberg, S. Brent Faulkner, Bosko Milekic, Daniel Rodríguez Troitiño, Genki Takiuchi, Geoffrey Grosenbach, Julien Sanchez, Kamal Fariz Mahyuddin, Masayoshi Takahashi, Patrick Aljordm, Mig, Kazuhiro Nishiyama, Jon Bardin, Konstantin Haase, Larry Siden, Matias Korhonen, Sam Ruby, Simon Chiang, Tim Connor, Timur Batyrshin, and Zach Brock for bug fixing and other improvements.;To;;0;[o; ;[I"]Eric Wong, Hongli Lai, Jeremy Kemper for their continuous support and API improvements.;To;;0;[o; ;[I"8Yehuda Katz and Carl Lerche for refactoring rackup.;To;;0;[o; ;[I"7Brian Candler, for <code>Rack::ContentType</code>.;To;;0;[o; ;[I"0Graham Batty, for improved handler loading.;To;;0;[o; ;[I"9Stephen Bannasch, for bug reports and documentation.;To;;0;[o; ;[I"OGary Wright, for proposing a better <code>Rack::Response</code> interface.;To;;0;[o; ;[I"KJonathan Buch, for improvements regarding <code>Rack::Response</code>.;To;;0;[o; ;[I"BArmin Röhrl, for tracking down bugs in the Cookie generator.;To;;0;[o; ;[I"JAlexander Kellett for testing the Gem and reviewing the announcement.;To;;0;[o; ;[I"GMarcus Rückert, for help with configuring and debugging lighttpd.;To;;0;[o; ;[I"]The WSGI team for the well-done and documented work they've done and Rack builds up on.;To;;0;[o; ;[I"BAll bug reporters and patch contributors not mentioned above.;TS; ; i;I"License;To; ;[I";Rack is released under the {MIT License}[MIT-LICENSE].;T: @file@:0@omit_headings_from_table_of_contents_below0