Merge pull request #15460 from backstage/rugvip/content

app-backend: avoid warning about missing app contents in development
This commit is contained in:
Ben Lambert
2022-12-30 11:27:02 +01:00
committed by GitHub
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();
}