-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsolution.rb
More file actions
64 lines (56 loc) · 1.01 KB
/
solution.rb
File metadata and controls
64 lines (56 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
require 'sinatra'
#get '/' do
# @name = params["name"]
# erb :index
#end
#
#post '/solution' do
# "¡Hola #{params[:name]}!"
#end
#get "/" do
# '">HcUy6Re2LLBRtj'
#end
# get "/" do
# sentence = "<h4>Hola</h4><br>"
# for number in 1..50 do
# if number % 2 == 0
# sentence += "<b>#{number} Soy Par!</b><br>"
# else
# sentence += "<b>#{number} Soy Impar!</b><br>"
# end
# end
# sentence
# end
# get "/" do
# @cuenta = 0
# erb :index
# end
#
# get "/sum" do
# @cuenta = params[:actual_sum].to_i + 1
# erb :index, locals: { actual_sum: @cuenta }
# end
# get "/" do
# erb :index2
# end
#
# get "/answer" do
# @nona_response = params[:nona_response]
# if @nona_response == @nona_response.upcase
# r = "<h1>Ahhh si, manzanas!</h1>"
# else
# r = "<h1>Habla mas duro mijito</h1>"
# end
# r
# end
# get "/" do
# request.user_agent
# end
get "/" do
if env['HTTP_PERMISO'] == "soy-un-token-secreto"
r = "Si lo logramos!"
else
r = "Sin Permiso"
end
r
end