Skip to content

Instantly share code, notes, and snippets.

@rummelonp
Last active December 17, 2015 21:49
Show Gist options
  • Save rummelonp/5677157 to your computer and use it in GitHub Desktop.
Save rummelonp/5677157 to your computer and use it in GitHub Desktop.
Sinatra と Grape 同時に使う
# -*- coding: utf-8 -*-
require 'grape'
require 'sinatra/base'
class App
def self.application
Rack::Cascade.new [Web, API]
end
class Web < Sinatra::Base
get '/' do
send_file File.join(settings.public_folder, 'index.html')
end
end
class API < Grape::API
prefix :api
end
end
# -*- coding: utf-8 -*-
require File.expand_path('app', File.dirname(__FILE__))
run App.application
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment