Skip to content

Commit

Permalink
add support for env var port for db
Browse files Browse the repository at this point in the history
  • Loading branch information
targoninc-alex committed Oct 3, 2024
1 parent c9ded01 commit 3c9ae78
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/features/database/mariaDbDatabase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export class MariaDbDatabase {

constructor(host: string | null = null, user: string | null = null, password: string | null = null, port: number | null = null) {
this.host = host || process.env.MYSQL_HOST || 'localhost';
this.port = port || 3306;
this.port = port || (process.env.MYSQL_PORT ? parseInt(process.env.MYSQL_PORT) : null) || 3306;
this.user = user || process.env.MYSQL_USER || 'root';
this.password = password || process.env.MYSQL_PASSWORD || '';
this.database = 'venel';
Expand Down

0 comments on commit 3c9ae78

Please sign in to comment.