Rails on Rack

448 views

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
448
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
4
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Rails on Rack

  1. 1. Monday, February 24, 14 1
  2. 2. O QUE É? Monday, February 24, 14 2
  3. 3. UMA ESPECIFICAÇÃO PARA COMUNICAÇÃO ENTRE APLICAÇÕES RUBY E SERVIDORES WEB Monday, February 24, 14 3
  4. 4. Request Monday, February 24, 14 WebServer Rack App 4
  5. 5. API RACK APP Qualquer objeto que responde ao metodo call e receba como parâmetro um objeto com os dados da requisição Retorna um array com 3 elementos [status, headers, response] Monday, February 24, 14 5
  6. 6. API RACK APP [status, headers, response] to_i Monday, February 24, 14 hash string each 6
  7. 7. EXEMPLO Monday, February 24, 14 7
  8. 8. proc {|env| [200, {"content-Type": "text/html"}, ["Olá frevoonrails"]] Monday, February 24, 14 8
  9. 9. RACK MIDDLEWARES Monday, February 24, 14 9
  10. 10. Request Middleware Middleware Rack App Monday, February 24, 14 10
  11. 11. RAILS ON RACK Monday, February 24, 14 11
  12. 12. RAKE MIDDLEWARE Monday, February 24, 14 12
  13. 13. ADICIONANDO UM RACK MIDDLEWARE AO RAILS Monday, February 24, 14 13
  14. 14. Crie seu arquivo “rack.rb” e adicione na pasta lib ou initializers Monday, February 24, 14 14
  15. 15. Adicione seu rack application application.rb Monday, February 24, 14 15
  16. 16. Verifique com “rake middleware” Monday, February 24, 14 16
  17. 17. USOS NA VIDA REAL Contador de acessos Bloquear acesso Devise(Warden) Monday, February 24, 14 17
  18. 18. REFERÊNCIAS http://guides.rubyonrails.org/rails_on_rack.html http://rack.github.io/ https://www.youtube.com/watch?v=TslkdT3PfKc& https://github.com/hassox/warden Monday, February 24, 14 18
  19. 19. OBRIGADO!! Monday, February 24, 14 19
  20. 20. OPS MAIS UMA COISA!! Monday, February 24, 14 20
  21. 21. Monday, February 24, 14 21

×