From 9ca647b3263500faa21f30421491ed6d5337010e Mon Sep 17 00:00:00 2001 From: Josef Date: Tue, 11 Nov 2025 11:33:59 +0100 Subject: [PATCH] Https Setup --- node/users/UserManagementServer.ts | 21 ++++++++++++++++++--- node/users/UserManagementServerSettings.ts | 2 ++ 2 files changed, 20 insertions(+), 3 deletions(-) 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;