app-backend: avoid warning about missing app contents in development

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2022-12-29 12:56:55 +01:00
parent e405fbf88a
commit b4ffa3bd91
2 changed files with 10 additions and 3 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-app-backend': patch
---
The warning for missing app contents is now logged as an error instead, but only in production.
+5 -3
View File
@@ -96,9 +96,11 @@ export async function createRouter(
const staticDir = resolvePath(appDistDir, 'static');
if (!(await fs.pathExists(staticDir))) {
logger.warn(
`Can't serve static app content from ${staticDir}, directory doesn't exist`,
);
if (process.env.NODE_ENV === 'production') {
logger.error(
`Can't serve static app content from ${staticDir}, directory doesn't exist`,
);
}
return Router();
}