Home / Class/ MyApp Class — astro Architecture

MyApp Class — astro Architecture

Architecture documentation for the MyApp class in server.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  6246d4e3_f4b0_188d_09b7_f93816624730["MyApp"]
  ffcd4bd1_b7ef_bc55_5e0c_8457f822e1b3["server.ts"]
  6246d4e3_f4b0_188d_09b7_f93816624730 -->|defined in| ffcd4bd1_b7ef_bc55_5e0c_8457f822e1b3
  d590ffc7_6b84_26a9_9a73_b0a97381ae34["constructor()"]
  6246d4e3_f4b0_188d_09b7_f93816624730 -->|method| d590ffc7_6b84_26a9_9a73_b0a97381ae34
  13c5e0e1_104e_f10a_3259_67152d2f6ba2["isDev()"]
  6246d4e3_f4b0_188d_09b7_f93816624730 -->|method| 13c5e0e1_104e_f10a_3259_67152d2f6ba2
  5ea5476f_923b_4fa5_df74_29602f99597c["render()"]
  6246d4e3_f4b0_188d_09b7_f93816624730 -->|method| 5ea5476f_923b_4fa5_df74_29602f99597c
  974e48c6_13cf_4af4_6b4f_bdb2746e176d["createPipeline()"]
  6246d4e3_f4b0_188d_09b7_f93816624730 -->|method| 974e48c6_13cf_4af4_6b4f_bdb2746e176d

Relationship Graph

Source Code

benchmark/packages/adapter/src/server.ts lines 5–33

class MyApp extends BaseApp {
	#manifest: SSRManifest | undefined;
	constructor(manifest: SSRManifest, streaming = false) {
		super(manifest, streaming);
		this.#manifest = manifest;
	}

	isDev(): boolean {
		return false;
	}

	async render(request: Request) {
		const url = new URL(request.url);
		if (this.#manifest?.assets.has(url.pathname)) {
			const filePath = new URL('../../client/' + this.removeBase(url.pathname), import.meta.url);
			const data = await fs.promises.readFile(filePath);
			return new Response(Buffer.from(data));
		}

		return super.render(request);
	}

	createPipeline(streaming: boolean) {
		return AppPipeline.create({
			manifest: this.manifest,
			streaming,
		});
	}
}

Frequently Asked Questions

What is the MyApp class?
MyApp is a class in the astro codebase, defined in benchmark/packages/adapter/src/server.ts.
Where is MyApp defined?
MyApp is defined in benchmark/packages/adapter/src/server.ts at line 5.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free