File tree Expand file tree Collapse file tree 2 files changed +13
-8
lines changed
Expand file tree Collapse file tree 2 files changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -5,12 +5,15 @@ const dotenv = require('dotenv');
55dotenv . config ( ) ;
66
77const mySQLdataController = { } ;
8+
89const SSL_KEY =
9- Buffer . from ( process . env . SSL_KEY , 'base64' ) . toString ( 'ascii' ) ||
10- fs . readFileSync ( './.cert/key.pem' ) . toString ( ) ;
10+ typeof process . env . SSL_KEY === 'string'
11+ ? Buffer . from ( process . env . SSL_KEY , 'base64' ) . toString ( 'ascii' )
12+ : fs . readFileSync ( './.cert/key.pem' ) . toString ( ) ;
1113const SSL_CERT =
12- Buffer . from ( process . env . SSL_CERT , 'base64' ) . toString ( 'ascii' ) ||
13- fs . readFileSync ( './.cert/cert.pem' ) . toString ( ) ;
14+ typeof process . env . SSL_CERT === 'string'
15+ ? Buffer . from ( process . env . SSL_CERT , 'base64' ) . toString ( 'ascii' )
16+ : fs . readFileSync ( './.cert/cert.pem' ) . toString ( ) ;
1417
1518/**
1619 * mySQLdataController.getSchema
Original file line number Diff line number Diff line change @@ -7,11 +7,13 @@ dotenv.config();
77
88const { USER_DB_USER , USER_DB_PW } = process . env ;
99const SSL_KEY =
10- Buffer . from ( process . env . SSL_KEY as string , 'base64' ) . toString ( 'ascii' ) ||
11- fs . readFileSync ( './.cert/key.pem' ) . toString ( ) ;
10+ typeof process . env . SSL_KEY === 'string'
11+ ? Buffer . from ( process . env . SSL_KEY , 'base64' ) . toString ( 'ascii' )
12+ : fs . readFileSync ( './.cert/key.pem' ) . toString ( ) ;
1213const SSL_CERT =
13- Buffer . from ( process . env . SSL_CERT as string , 'base64' ) . toString ( 'ascii' ) ||
14- fs . readFileSync ( './.cert/cert.pem' ) . toString ( ) ;
14+ typeof process . env . SSL_CERT === 'string'
15+ ? Buffer . from ( process . env . SSL_CERT , 'base64' ) . toString ( 'ascii' )
16+ : fs . readFileSync ( './.cert/cert.pem' ) . toString ( ) ;
1517
1618const pool = mysql
1719 . createPool ( {
You can’t perform that action at this time.
0 commit comments