Skip to content

Instantly share code, notes, and snippets.

@davidpelaez
Created October 4, 2013 01:17
Show Gist options
  • Select an option

  • Save davidpelaez/6819599 to your computer and use it in GitHub Desktop.

Select an option

Save davidpelaez/6819599 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'bundler/setup'
# include app and config folder in the load paths
$LOAD_PATH << File.join(File.dirname(__FILE__), 'app')
# assume we're in development
ENV['RACK_ENV'] ||= :development
# load all the gems
Bundler.require :default, ENV['RACK_ENV']
Dir[File.expand_path('../lib/*.rb', __FILE__)].each do |f|
require f
end
Dir[File.expand_path('../config/*.rb', __FILE__)].each do |f|
require f
end
Dir[File.expand_path('../app/representers/*.rb', __FILE__)].each do |f|
require f
end
Dir[File.expand_path('../app/models/*.rb', __FILE__)].each do |f|
require f
end
require 'api'
require 'rpc_api'
use Rack::Cors do
allow do
origins '*'
resource '*', headers: :any, methods: [:get, :post, :put, :delete, :options, :patch]
end
end
run App::API
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment