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');
5
5
dotenv . config ( ) ;
6
6
7
7
const mySQLdataController = { } ;
8
+
8
9
const 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 ( ) ;
11
13
const 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 ( ) ;
14
17
15
18
/**
16
19
* mySQLdataController.getSchema
Original file line number Diff line number Diff line change @@ -7,11 +7,13 @@ dotenv.config();
7
7
8
8
const { USER_DB_USER , USER_DB_PW } = process . env ;
9
9
const 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 ( ) ;
12
13
const 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 ( ) ;
15
17
16
18
const pool = mysql
17
19
. createPool ( {
You can’t perform that action at this time.
0 commit comments