Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Rails on Rack

497 views

Published on

Published in: Technology
  • Be the first to comment

  • Be the first to like this

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

×