import { Application } from "https://deno.land/x/aleph@v0.3.0-alpha.5/server/app.ts";
The Aleph Server Application class.
Methods
private
checkCompilationSideEffect(url: string, callback?: (mod: Module) => void)check compilation side-effect caused by dependency graph.
private
compile(url: string, options?: { sourceCode?: string; forceCompile?: boolean; bundleMode?: boolean; bundledModules?: string[]; }): Promise<Module>download and compile a moudle by given url, then cache on the disk.
private
copyDist()private
fetchDependency(url: string): Promise<Uint8Array>fetch dependency content, use deno builtin cache system
private
getHTMLScripts()private
getRouteModule(unnamed 0: Pick<Module, "url" | "hash">): RouteModulereturns the route module by given module.
private
runDenoBundle(bundleEntryFile: string,
bundleFile: string,
header?,
reload?,
run deno bundle and compess the output with terser.
private
transpile(sourceCode: string, options: TransformOptions)transpile code without types checking.
addPageModule(pathname: string, code: string): Promise<void>
add a new page module by given path and source code.
getPageHtml(loc: { pathname: string; search?: string; }): Promise<[number, string, Record<string, string> | null]>
getSSRData(loc: { pathname: string; search?: string; }): Promise<[number, any]>
handleAPI(req: ServerRequest, loc: { pathname: string; search?: string; })
isHMRable(url: string)
removePageModule(pathname: string): Promise<void>
add a new page module by given path and source code.