Skip to content
This repository was archived by the owner on Aug 3, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 8 additions & 13 deletions app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,30 +36,25 @@
set :root, File.expand_path('..', __FILE__)
set :port, 8001
set :bind, '0.0.0.0'

db = Config.load_config("database")
DataMapper.setup(
:default,
"mysql://" + db["user"] + ":" + db["password"] + "@" + db["hostname"]+ "/" + db["name"]
)

configure :development do
enable :unsecure

db = Config.load_config("development")
DataMapper::Logger.new($stdout, :debug)
DataMapper.setup(
:default,
"mysql://" + db["user"] + ":" + db["password"] + "@" + db["hostname"]+ "/" + db["name"]
)
use BetterErrors::Middleware
# you need to set the application root in order to abbreviate filenames
# within the application:

BetterErrors.application_root = File.expand_path('..', __FILE__)
DataMapper.auto_upgrade!
end

configure :production do
disable :unsecure

db = Config.load_config("production")
DataMapper.setup(
:default,
"mysql://" + db["user"] + ":" + db["password"] + "@" + db["hostname"]+ "/" + db["name"]
)
DataMapper.finalize
end

Expand Down
10 changes: 2 additions & 8 deletions config/secrets.yaml.template
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,8 @@ groot:
access_key: 'GROOT_ACCESS_KEY'
host: 'http://localhost:8000'

development:
database:
user: root
password: ""
hostname: localhost
name: groot_user_service_dev

test:
user: root
password: ""
hostname: localhost
name: groot_user_service_test
name: groot_user_service