Submit Search
Upload
Rack
•
0 likes
•
455 views
Revath S Kumar
Follow
Introduction to rack
Read less
Read more
Software
Report
Share
Report
Share
1 of 24
Download now
Download to read offline
Recommended
Rack
Rack
Aakanksha Bhardwaj
All girlhacknight intro to rails
All girlhacknight intro to rails
Nola Stowe
Ruby On Rails Starter Kit
Ruby On Rails Starter Kit
El Orabi Mohamed Ikbal
Laravel Beginners Tutorial 2
Laravel Beginners Tutorial 2
Vikas Chauhan
Gigigo Rails Workshop
Gigigo Rails Workshop
Alex Rupérez
Top laravel packages to install handpicked list from expert
Top laravel packages to install handpicked list from expert
Katy Slemon
Task scheduling in laravel 8 tutorial
Task scheduling in laravel 8 tutorial
Katy Slemon
Laravel 8 events and listeners with example
Laravel 8 events and listeners with example
Katy Slemon
Recommended
Rack
Rack
Aakanksha Bhardwaj
All girlhacknight intro to rails
All girlhacknight intro to rails
Nola Stowe
Ruby On Rails Starter Kit
Ruby On Rails Starter Kit
El Orabi Mohamed Ikbal
Laravel Beginners Tutorial 2
Laravel Beginners Tutorial 2
Vikas Chauhan
Gigigo Rails Workshop
Gigigo Rails Workshop
Alex Rupérez
Top laravel packages to install handpicked list from expert
Top laravel packages to install handpicked list from expert
Katy Slemon
Task scheduling in laravel 8 tutorial
Task scheduling in laravel 8 tutorial
Katy Slemon
Laravel 8 events and listeners with example
Laravel 8 events and listeners with example
Katy Slemon
Deploying Rails Apps with Capistrano
Deploying Rails Apps with Capistrano
Nyros Technologies
Webpack Encore Symfony Live 2017 San Francisco
Webpack Encore Symfony Live 2017 San Francisco
Ryan Weaver
Laravel 101
Laravel 101
Commit University
Cocoa on-rails-3rd
Cocoa on-rails-3rd
Xiaochun Shen
Presentation laravel 5 4
Presentation laravel 5 4
Christen Gjølbye Christensen
Getting to know Laravel 5
Getting to know Laravel 5
Bukhori Aqid
Laravel Beginners Tutorial 1
Laravel Beginners Tutorial 1
Vikas Chauhan
Ruby conf 2011, Create your own rails framework
Ruby conf 2011, Create your own rails framework
Pankaj Bhageria
Derailing rails
Derailing rails
Panagiotis Papadopoulos
Rails3 changesets
Rails3 changesets
Wen-Tien Chang
Rails Page Caching
Rails Page Caching
Travis Roberts
Laravel Starter Kit | Laravel Admin Template-ChandraAdmin
Laravel Starter Kit | Laravel Admin Template-ChandraAdmin
Lorvent56
Page life cycle IN ASP.NET
Page life cycle IN ASP.NET
Sireesh K
Dev streams2
Dev streams2
David Mc Donagh
Capistrano Deployment By Nyros Developer
Capistrano Deployment By Nyros Developer
Nyros Technologies
Intro to Laravel
Intro to Laravel
Azukisoft Pte Ltd
Symfony 4: A new way to develop applications #phpsrb
Symfony 4: A new way to develop applications #phpsrb
Antonio Peric-Mazar
Adventures in Laravel 5 SunshinePHP 2016 Tutorial
Adventures in Laravel 5 SunshinePHP 2016 Tutorial
Joe Ferguson
API Development with Laravel
API Development with Laravel
Michael Peacock
Angular2RoutingSetupByShubham
Angular2RoutingSetupByShubham
Shubham Verma
Intro to Rack
Intro to Rack
Rubyc Slides
Building WordPress Client Side Applications with WP and WP-API - #wcmia
Building WordPress Client Side Applications with WP and WP-API - #wcmia
Roy Sivan
More Related Content
What's hot
Deploying Rails Apps with Capistrano
Deploying Rails Apps with Capistrano
Nyros Technologies
Webpack Encore Symfony Live 2017 San Francisco
Webpack Encore Symfony Live 2017 San Francisco
Ryan Weaver
Laravel 101
Laravel 101
Commit University
Cocoa on-rails-3rd
Cocoa on-rails-3rd
Xiaochun Shen
Presentation laravel 5 4
Presentation laravel 5 4
Christen Gjølbye Christensen
Getting to know Laravel 5
Getting to know Laravel 5
Bukhori Aqid
Laravel Beginners Tutorial 1
Laravel Beginners Tutorial 1
Vikas Chauhan
Ruby conf 2011, Create your own rails framework
Ruby conf 2011, Create your own rails framework
Pankaj Bhageria
Derailing rails
Derailing rails
Panagiotis Papadopoulos
Rails3 changesets
Rails3 changesets
Wen-Tien Chang
Rails Page Caching
Rails Page Caching
Travis Roberts
Laravel Starter Kit | Laravel Admin Template-ChandraAdmin
Laravel Starter Kit | Laravel Admin Template-ChandraAdmin
Lorvent56
Page life cycle IN ASP.NET
Page life cycle IN ASP.NET
Sireesh K
Dev streams2
Dev streams2
David Mc Donagh
Capistrano Deployment By Nyros Developer
Capistrano Deployment By Nyros Developer
Nyros Technologies
Intro to Laravel
Intro to Laravel
Azukisoft Pte Ltd
Symfony 4: A new way to develop applications #phpsrb
Symfony 4: A new way to develop applications #phpsrb
Antonio Peric-Mazar
Adventures in Laravel 5 SunshinePHP 2016 Tutorial
Adventures in Laravel 5 SunshinePHP 2016 Tutorial
Joe Ferguson
API Development with Laravel
API Development with Laravel
Michael Peacock
Angular2RoutingSetupByShubham
Angular2RoutingSetupByShubham
Shubham Verma
What's hot
(20)
Deploying Rails Apps with Capistrano
Deploying Rails Apps with Capistrano
Webpack Encore Symfony Live 2017 San Francisco
Webpack Encore Symfony Live 2017 San Francisco
Laravel 101
Laravel 101
Cocoa on-rails-3rd
Cocoa on-rails-3rd
Presentation laravel 5 4
Presentation laravel 5 4
Getting to know Laravel 5
Getting to know Laravel 5
Laravel Beginners Tutorial 1
Laravel Beginners Tutorial 1
Ruby conf 2011, Create your own rails framework
Ruby conf 2011, Create your own rails framework
Derailing rails
Derailing rails
Rails3 changesets
Rails3 changesets
Rails Page Caching
Rails Page Caching
Laravel Starter Kit | Laravel Admin Template-ChandraAdmin
Laravel Starter Kit | Laravel Admin Template-ChandraAdmin
Page life cycle IN ASP.NET
Page life cycle IN ASP.NET
Dev streams2
Dev streams2
Capistrano Deployment By Nyros Developer
Capistrano Deployment By Nyros Developer
Intro to Laravel
Intro to Laravel
Symfony 4: A new way to develop applications #phpsrb
Symfony 4: A new way to develop applications #phpsrb
Adventures in Laravel 5 SunshinePHP 2016 Tutorial
Adventures in Laravel 5 SunshinePHP 2016 Tutorial
API Development with Laravel
API Development with Laravel
Angular2RoutingSetupByShubham
Angular2RoutingSetupByShubham
Similar to Rack
Intro to Rack
Intro to Rack
Rubyc Slides
Building WordPress Client Side Applications with WP and WP-API - #wcmia
Building WordPress Client Side Applications with WP and WP-API - #wcmia
Roy Sivan
Introduction to react
Introduction to react
kiranabburi
Ruby HTTP clients comparison
Ruby HTTP clients comparison
Hiroshi Nakamura
How to build Client Side Applications with WordPress and WP-API | #wcmia
How to build Client Side Applications with WordPress and WP-API | #wcmia
Roy Sivan
Rack Middleware
Rack Middleware
daviddollar
Get Going With RVM and Rails 3
Get Going With RVM and Rails 3
Karmen Blake
What's new in Rails 5 - API Mode & Action Cable overview
What's new in Rails 5 - API Mode & Action Cable overview
Maxim Veksler
Rhebok, High Performance Rack Handler / Rubykaigi 2015
Rhebok, High Performance Rack Handler / Rubykaigi 2015
Masahiro Nagano
Introduction to Rails - presented by Arman Ortega
Introduction to Rails - presented by Arman Ortega
arman o
Hello World on Slim Framework 3.x
Hello World on Slim Framework 3.x
Ryan Szrama
Rack
Rack
shen liu
How to perform debounce in react
How to perform debounce in react
BOSC Tech Labs
Dwr
Dwr
Suhas Kamble
Ninad cucumber rails
Ninad cucumber rails
ninad23p
Laravel development (Laravel History, Environment Setup & Laravel Installatio...
Laravel development (Laravel History, Environment Setup & Laravel Installatio...
Dilouar Hossain
Rails request & middlewares
Rails request & middlewares
Santosh Wadghule
Using Sinatra to Build REST APIs in Ruby
Using Sinatra to Build REST APIs in Ruby
LaunchAny
Construindo APIs Usando Rails
Construindo APIs Usando Rails
Fernando Kakimoto
Mini Rails Framework
Mini Rails Framework
Aviandri Rivai
Similar to Rack
(20)
Intro to Rack
Intro to Rack
Building WordPress Client Side Applications with WP and WP-API - #wcmia
Building WordPress Client Side Applications with WP and WP-API - #wcmia
Introduction to react
Introduction to react
Ruby HTTP clients comparison
Ruby HTTP clients comparison
How to build Client Side Applications with WordPress and WP-API | #wcmia
How to build Client Side Applications with WordPress and WP-API | #wcmia
Rack Middleware
Rack Middleware
Get Going With RVM and Rails 3
Get Going With RVM and Rails 3
What's new in Rails 5 - API Mode & Action Cable overview
What's new in Rails 5 - API Mode & Action Cable overview
Rhebok, High Performance Rack Handler / Rubykaigi 2015
Rhebok, High Performance Rack Handler / Rubykaigi 2015
Introduction to Rails - presented by Arman Ortega
Introduction to Rails - presented by Arman Ortega
Hello World on Slim Framework 3.x
Hello World on Slim Framework 3.x
Rack
Rack
How to perform debounce in react
How to perform debounce in react
Dwr
Dwr
Ninad cucumber rails
Ninad cucumber rails
Laravel development (Laravel History, Environment Setup & Laravel Installatio...
Laravel development (Laravel History, Environment Setup & Laravel Installatio...
Rails request & middlewares
Rails request & middlewares
Using Sinatra to Build REST APIs in Ruby
Using Sinatra to Build REST APIs in Ruby
Construindo APIs Usando Rails
Construindo APIs Usando Rails
Mini Rails Framework
Mini Rails Framework
More from Revath S Kumar
Meetups
Meetups
Revath S Kumar
gulp
gulp
Revath S Kumar
Unit testing with mocha
Unit testing with mocha
Revath S Kumar
VCR
VCR
Revath S Kumar
Modern frontend workflow
Modern frontend workflow
Revath S Kumar
Web components
Web components
Revath S Kumar
Setup nodejs
Setup nodejs
Revath S Kumar
Side projects : why it fails
Side projects : why it fails
Revath S Kumar
My webapp workflow
My webapp workflow
Revath S Kumar
Promises in JavaScript
Promises in JavaScript
Revath S Kumar
Prateek dayal backbonerails-110528024926-phpapp02
Prateek dayal backbonerails-110528024926-phpapp02
Revath S Kumar
More from Revath S Kumar
(11)
Meetups
Meetups
gulp
gulp
Unit testing with mocha
Unit testing with mocha
VCR
VCR
Modern frontend workflow
Modern frontend workflow
Web components
Web components
Setup nodejs
Setup nodejs
Side projects : why it fails
Side projects : why it fails
My webapp workflow
My webapp workflow
Promises in JavaScript
Promises in JavaScript
Prateek dayal backbonerails-110528024926-phpapp02
Prateek dayal backbonerails-110528024926-phpapp02
Recently uploaded
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Drew Moseley
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprise
preethippts
Software Coding for software engineering
Software Coding for software engineering
ssuserb3a23b
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
Velvetech LLC
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...
Technogeeks
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
OnePlan Solutions
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
StefanoLambiase
Odoo Development Company in India | Devintelle Consulting Service
Odoo Development Company in India | Devintelle Consulting Service
Devintelle Consulting Service Pvt Ltd Odoo OpenERP
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
confluent
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
Sujith Sukumaran
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
Alina Yurenko
cpct NetworkING BASICS AND NETWORK TOOL.ppt
cpct NetworkING BASICS AND NETWORK TOOL.ppt
rcbcrtm
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdf
Marharyta Nedzelska
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data Streams
Safe Software
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Ahmed Mohamed
2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva
Diego Iván Oliveros Acosta
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
Hanief Utama
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
Wave PLM
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Mater
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Development
vyaparkranti
Recently uploaded
(20)
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Software Coding for software engineering
Software Coding for software engineering
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Odoo Development Company in India | Devintelle Consulting Service
Odoo Development Company in India | Devintelle Consulting Service
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
cpct NetworkING BASICS AND NETWORK TOOL.ppt
cpct NetworkING BASICS AND NETWORK TOOL.ppt
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdf
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data Streams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Development
Rack
1.
INTRO TO RACK @revathskumar
2.
ABOUT Rubyist / JavaScripter Team Member / / Works at Blog at Twitter/Github - Google+: Yeoman @keralarb
@keralajs @whatznear blog.revathskumar.com @revathskumar +RevathSKumar
3.
A MODULAR RUBY WEBSERVER INTERFACE
4.
BASIC RACK APP require 'rack' app = Proc.new do | env | [200, {'Content-Type' => 'text/html'}, ['My first Rack app']] end Rack::Handler::WEBrick.run app
5.
MIDDLEWARES a way to filter a request and response
6.
ANY RUBY OBJECT WHICH RESPONDS TO CALL AND RETURN ARRAY OF 3 ELEMENTS
7.
CALL ACCEPTS ENV
8.
BASIC MIDDLEWARE class BasicMiddleware def initialize next_in_chain @app = next_in_chain end def call env @app.call(env) end end
9.
MIDDLEWARE CAN CALL EACH OTHERS TO CHAIN ACTIONS
10.
SO ORDER MATTERS
11.
MIDDLEWARE CHAIN class Mware def initialize next_in_chain @app = next_in_chain end def call env @app.call(env) end end class Mware1 def call env [200, {'content-type' => 'text/html'}, ["Hello Mware1"]] end end app = Proc.new do | env | Mware.new(Mware1.new).call(env) end
12.
RACK::BUILDER IMPLEMENTS A SMALL DSL TO ITERATIVELY CONSTRUCT RACK APPLICATIONS.
13.
require 'rack' app = Rack::Builder.new do use Rack::CommonLogger run Proc.new do | env | [200, {'Content-Type' => 'text/html'}, ['Using builder']] end end Rack::Handler::WEBrick.run app
14.
app = Proc.new { | env | stack = [ proc {|app| Mware.new app }, proc {|app| Mware1.new app } ] mware_obj = stack.reverse.inject(self){ | prev, curr| curr[prev] # curr.call(prev) } mware_obj.call(env) }
15.
ROUTES require 'rack' app = Rack::Builder.new do use Rack::CommonLogger map '/index' do run Proc.new do | env | [200, {'Content-Type' => 'text/html'}, ['Index']] end end run Proc.new do | env | [200, {'Content-Type' => 'text/html'}, ['Root']] end end Rack::Handler::WEBrick.run app
16.
NESTED ROUTES require 'rack' app = Rack::Builder.new do # ... map '/index' do # ... map '/1' do run Proc.new do | env | [200, {'Content-Type' => 'text/html'}, ['Index 1 ']] end end end # ... end Rack::Handler::WEBrick.run app
17.
VIEW class Basic def initialize app @index = File.read("index.html") end def call env [200, {'Content-Type' => 'text/html'}, [@index]] end end require 'rack' app = Rack::Builder.new do use Rack::CommonLogger run Basic.new end Rack::Handler::WEBrick.run app
18.
RENDERING ERB require "erb" class Basicerb attr_reader :rendered_html def initialize name @name = name @template = File.read('./index.erb') end def render ERB.new(@template, 0, "", "@rendered_html").result binding self end def call app [200, {'Content-Type' => 'text/html'}, [render.rendered_html]] end end
19.
ERB: LAYOUT & VIEW def initialize name @name = name @layout = File.read('./layout.erb') @template = File.read('./index.erb') end def render templates = [@template, @layout] @rendered_html = templates.inject(nil) do | prev, temp | _render(temp) { prev } end self end def _render temp ERB.new(temp).result( binding ) end
20.
RACK::STATIC Serve static files require 'rack' builder = Rack::Builder.new do use Rack::CommonLogger use Rack::Static, :urls => ['/bower_components/', '/assets/'], root: '.' end Rack::Handler::WEBrick.run builder
21.
RACK CONTRIB A collection of middlewares. rack/rack-contrib
22.
USING RACKUP # config.ru run Proc.new do | env | [200, {'Content-Type' => 'text/html'}, ['My first Rack app']] end ~$ rackup
23.
READ CONFIG.RU OR SUPPLIED CONFIG FILE CONVERT TO A INSTANCE OF RACK::BUILDER config_file = File.read(config) rack_application = eval("Rack::Builder.new { #{config_file} }")
24.
QUESTIONS? Revath S Kumar Github/Twitter: @revathskumar blog.revathskumar.com
Download now