Skip to content

Commit

Permalink
feat: Removes dotenv and updates password env variable
Browse files Browse the repository at this point in the history
Eliminates dotenv import and configuration as it's no longer needed.
Updates environment variable for PostgreSQL password to POSTGRES_PW.
  • Loading branch information
derrix060 committed Dec 19, 2024
1 parent 50ed7b5 commit a8b60c7
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions dashboard/src/server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,8 @@ import express from 'express';
import { fileURLToPath } from 'url';
import { dirname, join } from 'path';
import pg from 'pg';
import dotenv from 'dotenv';
import rateLimit from 'express-rate-limit';

// Load environment variables from .env file
dotenv.config();

// Create rate limiters
const apiLimiter = rateLimit({
windowMs: 15 * 60 * 1000, // 15 minutes
Expand Down Expand Up @@ -37,7 +33,7 @@ const initialPool = new Pool({
user: process.env.POSTGRES_USER,
host: process.env.POSTGRES_HOST,
database: 'postgres', // Connect to default postgres database first
password: process.env.POSTGRES_PASSWORD,
password: process.env.POSTGRES_PW,
port: process.env.POSTGRES_PORT || 5432,
ssl: {
require: true,
Expand All @@ -50,7 +46,7 @@ const appPool = new Pool({
user: process.env.POSTGRES_USER,
host: process.env.POSTGRES_HOST,
database: process.env.POSTGRES_DB,
password: process.env.POSTGRES_PASSWORD,
password: process.env.POSTGRES_PW,
port: process.env.POSTGRES_PORT || 5432,
ssl: {
require: true,
Expand Down

0 comments on commit a8b60c7

Please sign in to comment.