diff --git a/node/users/UserManagementServer.ts b/node/users/UserManagementServer.ts index 5da311a..d8c9ce8 100644 --- a/node/users/UserManagementServer.ts +++ b/node/users/UserManagementServer.ts @@ -1,4 +1,4 @@ -import Fastify, { FastifyInstance, FastifyListenOptions } from "fastify"; +import Fastify, { FastifyHttpsOptions, FastifyInstance, FastifyListenOptions } from "fastify"; import fastifyMultipart from "@fastify/multipart"; import cors from '@fastify/cors'; @@ -89,8 +89,23 @@ export class UserManagementServer async _initializeApp():Promise { - - this._app = Fastify(); + if ( this._settings.isDebugMode ) + { + this._app = Fastify(); + } + else + { + this._app = Fastify( + { + https: + { + key:this._settings.httpsKeyPath, + cert:this._settings.httpsCertPath + } + } + ); + } + this._app.register( fastifyMultipart ); for ( let corsURL of this._settings.corsURLs ) diff --git a/node/users/UserManagementServerSettings.ts b/node/users/UserManagementServerSettings.ts index 808bf29..6a9c438 100644 --- a/node/users/UserManagementServerSettings.ts +++ b/node/users/UserManagementServerSettings.ts @@ -8,6 +8,8 @@ export class UserManagementServerSettings port:number = 8084; corsURLs:string[] = []; isDebugMode:boolean = false; + httpsKeyPath:string; + httpsCertPath:string; // Paths rootPath:string;