-
-
Save ihsw/194d2c2faa764b97b80b 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
require 'sinatra/base' | |
require 'json' | |
require 'active_record' | |
require_relative './default_routes' | |
require_relative './posts_routes' | |
host = 'db' | |
if ENV['ENV'] == 'travis' | |
host = 'localhost' | |
end | |
ActiveRecord::Base.establish_connection("postgres://postgres@#{host}/postgres") | |
class Post < ActiveRecord::Base | |
end | |
class Server < Sinatra::Base | |
use DefaultRoutes | |
use PostsRoutes | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment