diff --git a/docs/latest/concepts/server-configuration.md b/docs/latest/concepts/server-configuration.md index 31b3f09f..e0300373 100644 --- a/docs/latest/concepts/server-configuration.md +++ b/docs/latest/concepts/server-configuration.md @@ -8,7 +8,7 @@ In this page we discuss how the server can be configured during startup. The signature of the primary method looks like this: ```ts main.ts -export async function start(routes: Manifest, opts: StartOptions = {}); +export async function start(manifest: Manifest, opts: StartOptions = {}); ``` ## Options diff --git a/src/server/mod.ts b/src/server/mod.ts index ac35c723..00c133b9 100644 --- a/src/server/mod.ts +++ b/src/server/mod.ts @@ -85,17 +85,17 @@ export interface Manifest { export { ServerContext }; export async function createHandler( - routes: Manifest, + manifest: Manifest, opts: StartOptions = {}, ): Promise< (req: Request, connInfo?: ServeHandlerInfo) => Promise > { - const ctx = await ServerContext.fromManifest(routes, opts); + const ctx = await ServerContext.fromManifest(manifest, opts); return ctx.handler(); } -export async function start(routes: Manifest, opts: StartOptions = {}) { - const ctx = await ServerContext.fromManifest(routes, { +export async function start(manifest: Manifest, opts: StartOptions = {}) { + const ctx = await ServerContext.fromManifest(manifest, { ...opts, skipSnapshot: false, dev: false, diff --git a/tests/fixture/main.ts b/tests/fixture/main.ts index 1409a21d..1895b320 100644 --- a/tests/fixture/main.ts +++ b/tests/fixture/main.ts @@ -5,7 +5,7 @@ /// import { start } from "$fresh/server.ts"; -import routes from "./fresh.gen.ts"; +import manifest from "./fresh.gen.ts"; import options from "./options.ts"; -await start(routes, options); +await start(manifest, options); diff --git a/tests/fixture/main_tls.ts b/tests/fixture/main_tls.ts index c95b489a..9a2daaeb 100644 --- a/tests/fixture/main_tls.ts +++ b/tests/fixture/main_tls.ts @@ -5,8 +5,8 @@ /// import { start } from "$fresh/server.ts"; -import routes from "./fresh.gen.ts"; +import manifest from "./fresh.gen.ts"; import options from "./options.ts"; // this just exists to function as a type check to assert that we can actually pass a key and cert in -await start(routes, { ...options, key: "test", cert: "test" }); +await start(manifest, { ...options, key: "test", cert: "test" }); diff --git a/tests/fixture/main_wasm.ts b/tests/fixture/main_wasm.ts index 946b1ede..0bf2b69e 100644 --- a/tests/fixture/main_wasm.ts +++ b/tests/fixture/main_wasm.ts @@ -8,7 +8,7 @@ import "./polyfill_deno_deploy.ts"; import { start } from "$fresh/server.ts"; -import routes from "./fresh.gen.ts"; +import manifest from "./fresh.gen.ts"; import options from "./options.ts"; -await start(routes, options); +await start(manifest, options); diff --git a/tests/fixture_build/main.ts b/tests/fixture_build/main.ts index bb97cc80..dedce9cb 100644 --- a/tests/fixture_build/main.ts +++ b/tests/fixture_build/main.ts @@ -5,6 +5,6 @@ /// import { start } from "$fresh/server.ts"; -import routes from "./fresh.gen.ts"; +import manifest from "./fresh.gen.ts"; -await start(routes); +await start(manifest); diff --git a/tests/fixture_build_out_dir/main.ts b/tests/fixture_build_out_dir/main.ts index bb97cc80..dedce9cb 100644 --- a/tests/fixture_build_out_dir/main.ts +++ b/tests/fixture_build_out_dir/main.ts @@ -5,6 +5,6 @@ /// import { start } from "$fresh/server.ts"; -import routes from "./fresh.gen.ts"; +import manifest from "./fresh.gen.ts"; -await start(routes); +await start(manifest); diff --git a/tests/fixture_build_out_dir_sub/src/main.ts b/tests/fixture_build_out_dir_sub/src/main.ts index bb97cc80..dedce9cb 100644 --- a/tests/fixture_build_out_dir_sub/src/main.ts +++ b/tests/fixture_build_out_dir_sub/src/main.ts @@ -5,6 +5,6 @@ /// import { start } from "$fresh/server.ts"; -import routes from "./fresh.gen.ts"; +import manifest from "./fresh.gen.ts"; -await start(routes); +await start(manifest); diff --git a/tests/fixture_build_out_dir_sub2/src/main.ts b/tests/fixture_build_out_dir_sub2/src/main.ts index bb97cc80..dedce9cb 100644 --- a/tests/fixture_build_out_dir_sub2/src/main.ts +++ b/tests/fixture_build_out_dir_sub2/src/main.ts @@ -5,6 +5,6 @@ /// import { start } from "$fresh/server.ts"; -import routes from "./fresh.gen.ts"; +import manifest from "./fresh.gen.ts"; -await start(routes); +await start(manifest); diff --git a/tests/fixture_build_sub_dir/src/main.ts b/tests/fixture_build_sub_dir/src/main.ts index bb97cc80..dedce9cb 100644 --- a/tests/fixture_build_sub_dir/src/main.ts +++ b/tests/fixture_build_sub_dir/src/main.ts @@ -5,6 +5,6 @@ /// import { start } from "$fresh/server.ts"; -import routes from "./fresh.gen.ts"; +import manifest from "./fresh.gen.ts"; -await start(routes); +await start(manifest); diff --git a/tests/fixture_build_target/main.ts b/tests/fixture_build_target/main.ts index bb97cc80..dedce9cb 100644 --- a/tests/fixture_build_target/main.ts +++ b/tests/fixture_build_target/main.ts @@ -5,6 +5,6 @@ /// import { start } from "$fresh/server.ts"; -import routes from "./fresh.gen.ts"; +import manifest from "./fresh.gen.ts"; -await start(routes); +await start(manifest); diff --git a/tests/fixture_config/main.ts b/tests/fixture_config/main.ts index 0df18bfc..edbe2b0a 100644 --- a/tests/fixture_config/main.ts +++ b/tests/fixture_config/main.ts @@ -5,7 +5,7 @@ /// import { start } from "$fresh/server.ts"; -import routes from "./fresh.gen.ts"; +import manifest from "./fresh.gen.ts"; const TEST_CONFIG_SERVER = Deno.env.get("TEST_CONFIG_SERVER") === "true"; const onListen = (params: { hostname: string; port: number }) => { @@ -17,7 +17,7 @@ const onListen2 = (params: { hostname: string; port: number }) => { console.log(`http://localhost:${params.port}`); }; -await start(routes, { +await start(manifest, { server: { onListen: TEST_CONFIG_SERVER ? onListen2 : undefined, }, diff --git a/tests/fixture_island_nesting/main.ts b/tests/fixture_island_nesting/main.ts index bb97cc80..dedce9cb 100644 --- a/tests/fixture_island_nesting/main.ts +++ b/tests/fixture_island_nesting/main.ts @@ -5,6 +5,6 @@ /// import { start } from "$fresh/server.ts"; -import routes from "./fresh.gen.ts"; +import manifest from "./fresh.gen.ts"; -await start(routes); +await start(manifest); diff --git a/tests/fixture_island_nesting/main_wasm.ts b/tests/fixture_island_nesting/main_wasm.ts index 714834e6..3e76084f 100644 --- a/tests/fixture_island_nesting/main_wasm.ts +++ b/tests/fixture_island_nesting/main_wasm.ts @@ -8,6 +8,6 @@ import "./polyfill_deno_deploy.ts"; import { start } from "$fresh/server.ts"; -import routes from "./fresh.gen.ts"; +import manifest from "./fresh.gen.ts"; -await start(routes); +await start(manifest); diff --git a/tests/fixture_npm/main.ts b/tests/fixture_npm/main.ts index bb97cc80..dedce9cb 100644 --- a/tests/fixture_npm/main.ts +++ b/tests/fixture_npm/main.ts @@ -5,6 +5,6 @@ /// import { start } from "$fresh/server.ts"; -import routes from "./fresh.gen.ts"; +import manifest from "./fresh.gen.ts"; -await start(routes); +await start(manifest); diff --git a/tests/fixture_preact_rts_v5/main.ts b/tests/fixture_preact_rts_v5/main.ts index 1409a21d..1895b320 100644 --- a/tests/fixture_preact_rts_v5/main.ts +++ b/tests/fixture_preact_rts_v5/main.ts @@ -5,7 +5,7 @@ /// import { start } from "$fresh/server.ts"; -import routes from "./fresh.gen.ts"; +import manifest from "./fresh.gen.ts"; import options from "./options.ts"; -await start(routes, options); +await start(manifest, options); diff --git a/tests/fixture_preact_rts_v5/main_wasm.ts b/tests/fixture_preact_rts_v5/main_wasm.ts index 946b1ede..0bf2b69e 100644 --- a/tests/fixture_preact_rts_v5/main_wasm.ts +++ b/tests/fixture_preact_rts_v5/main_wasm.ts @@ -8,7 +8,7 @@ import "./polyfill_deno_deploy.ts"; import { start } from "$fresh/server.ts"; -import routes from "./fresh.gen.ts"; +import manifest from "./fresh.gen.ts"; import options from "./options.ts"; -await start(routes, options); +await start(manifest, options); diff --git a/tests/fixture_router_ignore_files/main.ts b/tests/fixture_router_ignore_files/main.ts index 1409a21d..1895b320 100644 --- a/tests/fixture_router_ignore_files/main.ts +++ b/tests/fixture_router_ignore_files/main.ts @@ -5,7 +5,7 @@ /// import { start } from "$fresh/server.ts"; -import routes from "./fresh.gen.ts"; +import manifest from "./fresh.gen.ts"; import options from "./options.ts"; -await start(routes, options); +await start(manifest, options);