class Application
implements ServerApplication
import { Application } from "https://dotland.deno.dev/x/aleph@v0.3.0-alpha.31/server/mod.ts";
The application class for aleph server.
Properties
readonly
config: RequiredConfigreadonly
importMap: ImportMapMethods
private
applyCompilationSideEffect(url: string, callback: (mod: Module) => void)apply compilation side-effect caused by dependency graph breaking.
private
compile(url: string, options?: { sourceCode?: string; forceCompile?: boolean; once?: boolean; }): Promise<Module>compile a moudle by given url, then cache on the disk.
each moudle only be compiled once unless you set the
forceCompile
option to true.
private
createRouteUpdate(url: string): [string, string, { isIndex?: boolean; useDeno?: boolean; }]private
fetchModule(url: string): Promise<{ content: Uint8Array; contentType: string | null; }>fetch module content
private
precompile(url: string,
sourceContent: Uint8Array,
contentType: string | null,
private
updateImportUrls(jsContent: string, dep: DependencyDescriptor)update the hash in import url of deps.
addModule(url: string, options?: { code?: string; }): Promise<void>
add a new page module by given path and source code.
getAPIRoute(location: { pathname: string; search?: string; }): [RouterURL, Module] | null
get api route by given location.
getPageRoute(location: { pathname: string; search?: string; }): [RouterURL, RouteModule[]]
get page route by given location.