From 5d2c8b6b3c9ec14bf36080516b4de6db82c06e11 Mon Sep 17 00:00:00 2001 From: Reed von Redwitz Date: Sun, 6 Aug 2023 13:56:40 +0200 Subject: [PATCH] feat(server): support https (#1599) --- src/server/deps.ts | 1 - src/server/types.ts | 3 +-- tests/fixture/main_tls.ts | 12 ++++++++++++ 3 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 tests/fixture/main_tls.ts diff --git a/src/server/deps.ts b/src/server/deps.ts index 94eb5700..23e66404 100644 --- a/src/server/deps.ts +++ b/src/server/deps.ts @@ -12,7 +12,6 @@ export { type Handler as ServeHandler, serve, } from "https://deno.land/std@0.193.0/http/server.ts"; -export type { ServeInit } from "https://deno.land/std@0.193.0/http/server.ts"; export { Status } from "https://deno.land/std@0.193.0/http/http_status.ts"; export { typeByExtension, diff --git a/src/server/types.ts b/src/server/types.ts index 6aaaab44..0cf7d4e7 100644 --- a/src/server/types.ts +++ b/src/server/types.ts @@ -1,11 +1,10 @@ import { ComponentChildren, ComponentType, VNode } from "preact"; -import { ServeInit } from "./deps.ts"; import * as router from "./router.ts"; import { InnerRenderFunction, RenderContext } from "./render.ts"; // --- APPLICATION CONFIGURATION --- -export type StartOptions = ServeInit & FreshOptions; +export type StartOptions = Partial & FreshOptions; export interface FreshOptions { render?: RenderFunction; diff --git a/tests/fixture/main_tls.ts b/tests/fixture/main_tls.ts new file mode 100644 index 00000000..c95b489a --- /dev/null +++ b/tests/fixture/main_tls.ts @@ -0,0 +1,12 @@ +/// +/// +/// +/// +/// + +import { start } from "$fresh/server.ts"; +import routes 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" });