-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.ru
More file actions
72 lines (64 loc) · 2.79 KB
/
config.ru
File metadata and controls
72 lines (64 loc) · 2.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
require 'sinatra/base'
require 'active_record'
require File.expand_path("../controllers/application_controller.rb", __FILE__)
require File.expand_path("../controllers/sessions_controller.rb", __FILE__)
require File.expand_path("../controllers/users_controller.rb", __FILE__)
require File.expand_path("../controllers/verifications_controller.rb", __FILE__)
require File.expand_path("../controllers/OAuthV1AuthenticationStrategy.rb", __FILE__)
require File.expand_path("../controllers/OAuthV2AuthenticationStrategy.rb", __FILE__)
require File.expand_path("../controllers/GoogleAuthenticationStrategy.rb", __FILE__)
require File.expand_path("../controllers/FacebookAuthenticationStrategy.rb", __FILE__)
require File.expand_path("../controllers/MailchimpAuthenticationStrategy.rb", __FILE__)
require File.expand_path("../controllers/TwitterAuthenticationStrategy.rb", __FILE__)
require File.expand_path("../controllers/auth_controller.rb", __FILE__)
require File.expand_path("../controllers/google_test_controller.rb", __FILE__)
require File.expand_path("../controllers/twitter_test_controller.rb", __FILE__)
require File.expand_path("../controllers/facebook_test_controller.rb", __FILE__)
require File.expand_path("../models/user.rb", __FILE__)
require File.expand_path("../models/provider.rb", __FILE__)
map('/users') { run UsersController }
map('/sessions') { run SessionsController }
map('/verifications') { run VerificationsController }
map('/auth') { run AuthController }
map('/') { run ApplicationController }
map('/google_test') { run GoogleTestController }
map('/twitter_test') { run TwitterTestController }
map('/facebook_test') { run FacebookTestController }
if ENV['RACK_ENV']=='production'
ActiveRecord::Base.establish_connection(ENV["DATABASE_URL"])
else
if ENV['RACK_ENV']=='test'
ActiveRecord::Base.establish_connection(
:adapter => 'sqlite3',
:database => ':memory:'
)
else
ActiveRecord::Base.establish_connection(
:adapter => 'sqlite3',
:database => 'file'
)
end
end
ActiveRecord::Base.logger = Logger.new(STDERR)
ActiveRecord::Schema.define do
unless ActiveRecord::Base.connection.tables.include? 'users'
create_table :users do |table|
table.column :email, :string
table.column :password, :string
table.column :verified, :bool
table.column :verification_id, :string
end
end
unless ActiveRecord::Base.connection.tables.include? 'providers'
create_table :providers do |table|
table.column :name, :string
table.column :userid, :numeric
table.column :access_token, :string
table.column :access_token_secret, :string
table.column :expiration_date, :date
table.column :token_type, :string
table.column :refresh_token, :string
table.column :raw_response, :string
end
end
end