mentiflectax / 50web

Sinatra websites using a50c gem
0 stars 0 forks source link

Put the connection credentials to the right place #11

Closed mentiflectax closed 8 years ago

mentiflectax commented 8 years ago

Currently, they are located here:

before do
    env['rack.errors'] = log
    # TODO: Put the connection credentials to the right place
    Object.const_set(:DB, PG::Connection.new(
        dbname: 'd50b', 
        user: 'd50b', 
        password: 'postgres', 
        host: 'localhost',
        port: '5432'
        )
    )
    @db = getdb('songcontest')
    @peepsdb = getdb('peeps')
end

We need to put them into the right place such that nothing is hardcoded, especially the password.

mentiflectax commented 8 years ago

Now the connection credentials are located in songcontest.yml file. Details can be found here.