app-backend: make "app" the default app package

Co-authored-by: Fredrik Adelöw <freben@gmail.com>
Co-authored-by: Johan Haals <johan.haals@gmail.com>
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2022-09-26 16:49:55 +02:00
parent 96d288a02d
commit fff524b44d
3 changed files with 7 additions and 4 deletions
+1 -1
View File
@@ -14,7 +14,7 @@ export const appPlugin: (options: AppPluginOptions) => BackendFeature;
// @alpha (undocumented)
export type AppPluginOptions = {
appPackageName: string;
appPackageName?: string;
staticFallbackHandler?: express.Handler;
disableConfigInjection?: boolean;
disableStaticFallbackCache?: boolean;
@@ -77,5 +77,8 @@ describe('appPlugin', () => {
res.text(),
),
).resolves.toBe('winning');
await expect(
fetch(`http://localhost:${port}`).then(res => res.text()),
).resolves.toBe('winning');
});
});
+3 -3
View File
@@ -33,9 +33,9 @@ export type AppPluginOptions = {
* from. The same app package should be added as a dependency to the backend
* package in order for it to be accessible at runtime.
*
* In a typical setup with a single app package, this would be set to 'app'.
* In a typical setup with a single app package, this will default to 'app'.
*/
appPackageName: string;
appPackageName?: string;
/**
* A request handler to handle requests for static content that are not present in the app bundle.
@@ -96,7 +96,7 @@ export const appPlugin = createBackendPlugin({
logger: winstonLogger,
config,
database: disableStaticFallbackCache ? undefined : database,
appPackageName,
appPackageName: appPackageName ?? 'app',
staticFallbackHandler,
disableConfigInjection,
});