diff --git a/src/database.rb b/src/database.rb index 2f2eaf4..cee0f9d 100644 --- a/src/database.rb +++ b/src/database.rb @@ -19,7 +19,11 @@ require 'pg' class Database def initialize # Connect once when the bot starts - @conn = PG.connect(dbname: 'fgbot_db') + @conn = PG.connect( + host: ENV['DB_HOST'] || 'localhost', + dbname: ENV['DB_NAME'] || 'fgbot_db' + user: ENV['DB_USER'] || 'postgres' + ) init_tables end