From 5801eddeab5a051b46f568098cfa8122dbb6db3b Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Fri, 17 Feb 2023 08:46:45 +0100 Subject: [PATCH 1/3] remove the log line telling the user we're using their static dir --- code/lib/core-server/src/utils/server-statics.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/code/lib/core-server/src/utils/server-statics.ts b/code/lib/core-server/src/utils/server-statics.ts index 4126423cb09b..1128cad6ff1f 100644 --- a/code/lib/core-server/src/utils/server-statics.ts +++ b/code/lib/core-server/src/utils/server-statics.ts @@ -41,10 +41,7 @@ export async function useStatics(router: any, options: Options) { directory: dir, }) : dir; - const { staticDir, staticPath, targetEndpoint } = await parseStaticDir(relativeDir); - logger.info( - chalk`=> Serving static files from {cyan ${staticDir}} at {cyan ${targetEndpoint}}` - ); + const { staticPath, targetEndpoint } = await parseStaticDir(relativeDir); router.use(targetEndpoint, express.static(staticPath, { index: false })); } catch (e) { logger.warn(e.message); From ac7fe36d474857be0e3d6ef84064e5e8d90aee9d Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Tue, 21 Feb 2023 09:51:20 +0100 Subject: [PATCH 2/3] make it not log for default staticDirs --- code/lib/core-server/src/utils/server-statics.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/code/lib/core-server/src/utils/server-statics.ts b/code/lib/core-server/src/utils/server-statics.ts index 1128cad6ff1f..98c739157dd7 100644 --- a/code/lib/core-server/src/utils/server-statics.ts +++ b/code/lib/core-server/src/utils/server-statics.ts @@ -41,7 +41,15 @@ export async function useStatics(router: any, options: Options) { directory: dir, }) : dir; - const { staticPath, targetEndpoint } = await parseStaticDir(relativeDir); + const { staticDir, staticPath, targetEndpoint } = await parseStaticDir(relativeDir); + + // Don't log for the internal static dir + if (!targetEndpoint.startsWith('sb-')) { + logger.info( + chalk`=> Serving static files from {cyan ${staticDir}} at {cyan ${targetEndpoint}}` + ); + } + router.use(targetEndpoint, express.static(staticPath, { index: false })); } catch (e) { logger.warn(e.message); From efecf5386955add4f6016311f1c41db5770e72a3 Mon Sep 17 00:00:00 2001 From: Michael Shilman Date: Thu, 9 Mar 2023 18:39:09 +0800 Subject: [PATCH 3/3] Fix typo --- code/lib/core-server/src/utils/server-statics.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/lib/core-server/src/utils/server-statics.ts b/code/lib/core-server/src/utils/server-statics.ts index 98c739157dd7..96386df1d05a 100644 --- a/code/lib/core-server/src/utils/server-statics.ts +++ b/code/lib/core-server/src/utils/server-statics.ts @@ -44,7 +44,7 @@ export async function useStatics(router: any, options: Options) { const { staticDir, staticPath, targetEndpoint } = await parseStaticDir(relativeDir); // Don't log for the internal static dir - if (!targetEndpoint.startsWith('sb-')) { + if (!targetEndpoint.startsWith('/sb-')) { logger.info( chalk`=> Serving static files from {cyan ${staticDir}} at {cyan ${targetEndpoint}}` );