Permalink
Browse files

Add Grape and our first endpoint

  • Loading branch information...
tonymadbrain committed Nov 24, 2015
1 parent 20040af commit 158fc4b38f664ae242a6c9d6fd6e0bbcc100c9db
Showing with 123 additions and 0 deletions.
  1. +22 −0 .gitignore
  2. +7 −0 Gemfile
  3. +68 −0 Gemfile.lock
  4. +1 −0 Procfile
  5. +12 −0 app/api/notes.rb
  6. +5 −0 app/core.rb
  7. +8 −0 config.ru
View
@@ -0,0 +1,22 @@
# See https://help.github.com/articles/ignoring-files for more about ignoring files.
#
# If you find yourself ignoring temporary files generated by your text editor
# or operating system, you probably want to add a global ignore instead:
# git config --global core.excludesfile '~/.gitignore_global'
# Ignore bundler config.
/.bundle
# Ignore all logfiles and tempfiles.
/log/*
!/log/.keep
/tmp
# IDE specific
.idea/
#mac_os specific
*.DS_Store
#ruby version and gem
.ruby-*
View
@@ -0,0 +1,7 @@
source 'https://rubygems.org'
ruby '2.2.3'
gem 'grape'
gem 'pry'
gem 'awesome_print'
View
@@ -0,0 +1,68 @@
GEM
remote: https://rubygems.org/
specs:
activesupport (4.2.5)
i18n (~> 0.7)
json (~> 1.7, >= 1.7.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
awesome_print (1.6.1)
axiom-types (0.1.1)
descendants_tracker (~> 0.0.4)
ice_nine (~> 0.11.0)
thread_safe (~> 0.3, >= 0.3.1)
builder (3.2.2)
coderay (1.1.0)
coercible (1.0.0)
descendants_tracker (~> 0.0.1)
descendants_tracker (0.0.4)
thread_safe (~> 0.3, >= 0.3.1)
equalizer (0.0.11)
grape (0.13.0)
activesupport
builder
hashie (>= 2.1.0)
multi_json (>= 1.3.2)
multi_xml (>= 0.5.2)
rack (>= 1.3.0)
rack-accept
rack-mount
virtus (>= 1.0.0)
hashie (3.4.3)
i18n (0.7.0)
ice_nine (0.11.1)
json (1.8.3)
method_source (0.8.2)
minitest (5.8.3)
multi_json (1.11.2)
multi_xml (0.5.5)
pry (0.10.3)
coderay (~> 1.1.0)
method_source (~> 0.8.1)
slop (~> 3.4)
rack (1.6.4)
rack-accept (0.4.5)
rack (>= 0.4)
rack-mount (0.8.3)
rack (>= 1.0.0)
slop (3.6.0)
thread_safe (0.3.5)
tzinfo (1.2.2)
thread_safe (~> 0.1)
virtus (1.0.5)
axiom-types (~> 0.1)
coercible (~> 1.0)
descendants_tracker (~> 0.0, >= 0.0.3)
equalizer (~> 0.0, >= 0.0.9)
PLATFORMS
ruby
DEPENDENCIES
awesome_print
grape
pry
BUNDLED WITH
1.10.6
View
@@ -0,0 +1 @@
web: bundle exec rackup -p $PORT
View
@@ -0,0 +1,12 @@
class Notes < Grape::API
version 'v1', using: :header, vendor: 'tonymadbrain'
format :json
resource 'notes' do
get '/test' do
{ data: "TEST" }
end
end
end
View
@@ -0,0 +1,5 @@
require 'rubygems'
require 'bundler'
Bundler.require
app_base = "#{File.dirname(File.expand_path(__FILE__))}/.."
View
@@ -0,0 +1,8 @@
require 'rack'
require 'rubygems'
require 'bundler/setup'
require 'grape'
require './app/core'
require './app/api/notes'
run Notes

0 comments on commit 158fc4b

Please sign in to comment.