gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-wallet-core] branch master updated: make tls optional


From: gnunet
Subject: [taler-wallet-core] branch master updated: make tls optional
Date: Fri, 05 Jan 2024 13:53:11 +0100

This is an automated email from the git hooks/post-receive script.

sebasjm pushed a commit to branch master
in repository wallet-core.

The following commit(s) were added to refs/heads/master by this push:
     new 5208df82d make tls optional
5208df82d is described below

commit 5208df82d61091bb5492b215d2acf842e89fc048
Author: Sebastian <sebasjm@gmail.com>
AuthorDate: Fri Jan 5 09:52:56 2024 -0300

    make tls optional
---
 packages/web-util/src/serve.ts | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/packages/web-util/src/serve.ts b/packages/web-util/src/serve.ts
index 3d2744bb9..1daea15bf 100644
--- a/packages/web-util/src/serve.ts
+++ b/packages/web-util/src/serve.ts
@@ -29,6 +29,7 @@ export async function serve(opts: {
   folder: string;
   port: number;
   source?: string;
+  tls?: boolean;
   examplesLocationJs?: string;
   examplesLocationCss?: string;
   onSourceUpdate?: () => Promise<void>;
@@ -39,9 +40,14 @@ export async function serve(opts: {
 
   const httpServer = http.createServer(app);
   const httpPort = opts.port;
-  const httpsServer = https.createServer(httpServerOptions, app);
-  const httpsPort = opts.port + 1;
-  const servers = [httpServer, httpsServer];
+  let httpsServer: typeof httpServer | undefined;
+  let httpsPort: number | undefined;
+  const servers = [httpServer];
+  if (opts.tls) {
+    httpsServer = https.createServer(httpServerOptions, app);
+    httpsPort = opts.port + 1;
+    servers.push(httpsServer)
+  }
 
   logger.info(`Dev server. Endpoints:`);
   logger.info(`  ${PATHS.APP}: where root application can be tested`);
@@ -120,6 +126,8 @@ export async function serve(opts: {
 
   logger.info(`Serving ${opts.folder} on ${httpPort}: plain HTTP`);
   httpServer.listen(httpPort);
-  logger.info(`Serving ${opts.folder} on ${httpsPort}: HTTP + TLS`);
-  httpsServer.listen(httpsPort);
+  if (httpsServer !== undefined) {
+    logger.info(`Serving ${opts.folder} on ${httpsPort}: HTTP + TLS`);
+    httpsServer.listen(httpsPort);
+  }
 }

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]