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:
@@ -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');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user