diff --git a/node/files/FilesSync.ts b/node/files/FilesSync.ts index 19fe792..76b5440 100644 --- a/node/files/FilesSync.ts +++ b/node/files/FilesSync.ts @@ -1,4 +1,22 @@ +import * as fs from 'fs'; +import { RJLog } from '../log/RJLog'; + export class FilesSync { - + static loadUTF8( filePath:string ):string + { + try + { + let data = fs.readFileSync( filePath ); + let stringData = data.toString(); + return stringData; + } + catch ( exception ) + { + RJLog.log( exception ); + } + + return null; + + } } \ No newline at end of file diff --git a/node/users/UserManagementServer.ts b/node/users/UserManagementServer.ts index d8c9ce8..5557539 100644 --- a/node/users/UserManagementServer.ts +++ b/node/users/UserManagementServer.ts @@ -15,6 +15,7 @@ import { Files } from "../files/Files"; import { LocationService } from "./location/LocationService"; import { RequestRequirement } from "./requirements/RequestRequirement"; import { NotTooManyRequests } from "./requirements/security/NotTooManyRequests"; +import { FilesSync } from "../files/FilesSync"; export class UserManagementServer { @@ -99,8 +100,8 @@ export class UserManagementServer { https: { - key:this._settings.httpsKeyPath, - cert:this._settings.httpsCertPath + key:FilesSync.loadUTF8( this._settings.httpsKeyPath ), + cert:FilesSync.loadUTF8( this._settings.httpsCertPath ) } } );