Created
August 27, 2014 17:27
-
-
Save kisai/5af3d717fcbf68ee8035 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://robots.thoughtbot.com/how-to-share-a-session-between-sinatra-and-rails | |
# wanna do this | |
get '/dashboard' do | |
if session[:user_id].present? | |
redirect to('/') | |
else | |
# set up and render dashboard | |
end | |
end | |
# then | |
# Rack::Builder | |
# config.ru | |
map '/api' do | |
run MySinatraApp.new | |
end | |
map '/' do | |
run MyRailsApp::Application.new | |
end | |
#or we can load sinatra apps with in rails | |
MyRailsApp::Application.routes.draw do | |
mount MySinatraApp.new => '/api' | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment