Permalink
Browse files

Add slowpath

  • Loading branch information...
kirs committed Apr 1, 2018
1 parent a784a5d commit c3d9cd5d221a49b9907823f865ee73833be58dca
Showing with 12 additions and 0 deletions.
  1. +11 −0 app/controllers/helloworld_controller.rb
  2. +1 −0 config/routes.rb
@@ -2,4 +2,15 @@ class HelloworldController < ApplicationController
def index
@credentials = Rails.application.credentials.config
end

def slow
render plain: fibonacci(37)
end

private

def fibonacci(n)
return n if n <= 1
fibonacci( n - 1 ) + fibonacci( n - 2 )
end
end
@@ -1,4 +1,5 @@
Rails.application.routes.draw do
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
root 'helloworld#index'
get '/slowpath' => 'helloworld#slow'
end

0 comments on commit c3d9cd5

Please sign in to comment.