UNPKG

one

Version:

One is a React framework for web, iOS, and Android apps.

29 lines (26 loc) • 1.1 kB
import { setServerGlobals } from "./server/setServerGlobals.native.js"; import { setupBuildInfo } from "./server/setupBuildOptions.native.js"; import { createWorkerHandler } from "./server/workerHandler.native.js"; import { ensureExists } from "./utils/ensureExists.native.js"; import { getFetchStaticHtml, setFetchStaticHtml } from "./server/staticHtmlFetcher.native.js"; import { withRange } from "./server/assetRange.native.js"; async function serve(buildInfo, lazyRoutes, serveOptions) { setupBuildInfo(buildInfo); ensureExists(buildInfo.oneOptions); setServerGlobals(); var handler = createWorkerHandler({ oneOptions: buildInfo.oneOptions, buildInfo, lazyRoutes, disableModuleCache: serveOptions === null || serveOptions === void 0 ? void 0 : serveOptions.disableModuleCache }); return { fetch: handler.handleRequest, updateRoutes(newBuildInfo, newLazyRoutes) { setupBuildInfo(newBuildInfo); handler.updateRoutes(newBuildInfo, newLazyRoutes); } }; } export { getFetchStaticHtml, serve, setFetchStaticHtml, withRange }; //# sourceMappingURL=serve-worker.native.js.map