Added proper config options for PostgreSQL

This commit is contained in:
TheEssem 2020-12-18 15:42:34 -06:00
parent 873b3f59bc
commit 3594c4d353
2 changed files with 13 additions and 6 deletions

View File

@ -8,11 +8,18 @@ NODE_ENV=development
# Put Discord token here
TOKEN=
# Put database type here
# Put database type here (mongo or postgres)
DB=mongo
# Put MongoDB database URL here
# If you're using MongoDB, put the database URL here
MONGO=mongodb://localhost:27017/esmBot
# If you're using Postgres, fill in the needed info here
PG_USER=esmbot
PG_HOST=localhost
PG_DB=esmbot
PG_PORT=5432
# Put snowflake ID of bot owner here
OWNER=

View File

@ -31,10 +31,10 @@ if (process.env.DB === "mongo") {
} else if (process.env.DB === "postgres") {
const { Pool } = require("pg");
const pool = new Pool({
user: "esmbot",
host: "localhost",
database: "esmbot",
port: 5432
user: process.env.PG_USER,
host: process.env.PG_HOST,
database: process.env.PG_DB,
port: process.env.PG_PORT
});
exports.connection = pool;
}