diff options
| author | mo khan <mo@mokhan.ca> | 2014-02-03 22:07:24 -0700 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2014-02-03 22:07:24 -0700 |
| commit | 6a2dd4c273dea4ca34e42919bf34eb5e3733b2c4 (patch) | |
| tree | 6602d930bde2a46b8bc034ae69245c8f7795d61c | |
| parent | 6d9fc91b5da8e7af3b6050f129d8d41e9b2715f8 (diff) | |
build minimal sinatra app.
| -rw-r--r-- | Gemfile | 3 | ||||
| -rw-r--r-- | Gemfile.lock | 2 | ||||
| -rw-r--r-- | hi.rb | 11 |
3 files changed, 15 insertions, 1 deletions
@@ -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 @@ -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 |
