Skip to content

Instantly share code, notes, and snippets.

@ohcibi
Last active August 29, 2015 14:19
Show Gist options
  • Save ohcibi/100f78a8504bbb12293d to your computer and use it in GitHub Desktop.
Save ohcibi/100f78a8504bbb12293d to your computer and use it in GitHub Desktop.
require 'sinatra'
require 'sinatra/activerecord'
require './config/environments'
get "/" do
puts "hallo"
end
require 'yaml'
configure :development, :production do
set :public_folder, Proc.new { File.join root, "public/dist" }
end
configure :development do
puts "development"
ActiveRecord::Base.establish_connection(
adapter: :sqlite3,
database: "db/development.sqlite3"
)
end
configure :production do
puts "production"
ActiveRecord::Base.establish_connection(
adapter: :sqlite3,
database: "db/production.sqlite3"
)
end
configure :test do
puts "test"
ActiveRecord::Base.establish_connection(
adapter: :sqlite3,
database: "db/test.sqlite3"
)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment