Fix export. Add async manifest factory (#67)
This commit is contained in:
parent
9b5ed6471d
commit
1504036698
2 changed files with 3 additions and 2 deletions
|
@ -6,7 +6,7 @@ import { withBaseURL } from "../../middleware";
|
||||||
import { AppManifest } from "../../types";
|
import { AppManifest } from "../../types";
|
||||||
|
|
||||||
export type CreateManifestHandlerOptions = {
|
export type CreateManifestHandlerOptions = {
|
||||||
manifestFactory(context: { appBaseUrl: string }): AppManifest;
|
manifestFactory(context: { appBaseUrl: string }): AppManifest | Promise<AppManifest>;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -18,7 +18,7 @@ export const createManifestHandler = (options: CreateManifestHandlerOptions) =>
|
||||||
const baseHandler: Handler = async (request) => {
|
const baseHandler: Handler = async (request) => {
|
||||||
const { baseURL } = request.context;
|
const { baseURL } = request.context;
|
||||||
|
|
||||||
const manifest = options.manifestFactory({
|
const manifest = await options.manifestFactory({
|
||||||
appBaseUrl: baseURL,
|
appBaseUrl: baseURL,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
|
export * from "./create-app-register-handler";
|
||||||
export * from "./create-manifest-handler";
|
export * from "./create-manifest-handler";
|
||||||
|
|
Loading…
Reference in a new issue