summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2014-02-03 22:07:24 -0700
committermo khan <mo@mokhan.ca>2014-02-03 22:07:24 -0700
commit6a2dd4c273dea4ca34e42919bf34eb5e3733b2c4 (patch)
tree6602d930bde2a46b8bc034ae69245c8f7795d61c
parent6d9fc91b5da8e7af3b6050f129d8d41e9b2715f8 (diff)
build minimal sinatra app.
-rw-r--r--Gemfile3
-rw-r--r--Gemfile.lock2
-rw-r--r--hi.rb11
3 files changed, 15 insertions, 1 deletions
diff --git a/Gemfile b/Gemfile
index 94fc334..4b7dca3 100644
--- a/Gemfile
+++ b/Gemfile
@@ -1,3 +1,4 @@
source "https://rubygems.org"
-gem "sinatra"
+gem 'sinatra'
+gem 'json'
diff --git a/Gemfile.lock b/Gemfile.lock
index deb44d8..67c6e7f 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -1,6 +1,7 @@
GEM
remote: https://rubygems.org/
specs:
+ json (1.8.1)
rack (1.5.2)
rack-protection (1.5.2)
rack
@@ -14,4 +15,5 @@ PLATFORMS
ruby
DEPENDENCIES
+ json
sinatra
diff --git a/hi.rb b/hi.rb
new file mode 100644
index 0000000..18729cc
--- /dev/null
+++ b/hi.rb
@@ -0,0 +1,11 @@
+require "sinatra"
+require 'json'
+
+get '/login/:id/:password' do |id, password|
+ content_type :json
+ if id == "1" && password == '1234'
+ { success: true }.to_json
+ else
+ { success: false }.to_json
+ end
+end