Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Done #1290

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Done #1290

Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Done.
das11706 committed May 3, 2021
commit 2231323bc04d81bae9eaea1b783fac29162b720f
14 changes: 9 additions & 5 deletions app/application.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require 'pry'

class Application

@@item = ["3.42"]
@@ -6,17 +8,19 @@ def call(env)
resp = Rack::Response.new
req = Rack::Request.new(env)

if req.path.match(/testing/)
# if req.path.match(/testing/)
# if req.path=="/testing"
if req.path.match(/items/)
binding.pry
resp.write "Route not found"
resp.status = 404
elsif req.path.match(/items/)
@@item.each do |item|
resp.write "#{item}\n"
end
elsif !@@item.include?(@@item.last)
resp.write "Item not found"
resp.status = 400
else
# !@@item.include?(@@item.last)
# resp.write "Item not found"
resp.status = 404
end
resp.finish
end