feat(server): support https (#1599)

This commit is contained in:
Reed von Redwitz
2023-08-06 11:56:40 +00:00
committed by GitHub
parent e0bd5969e8
commit 5d2c8b6b3c
3 changed files with 13 additions and 3 deletions
-1
View File
@@ -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,
+1 -2
View File
@@ -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<Deno.ServeTlsOptions> & FreshOptions;
export interface FreshOptions {
render?: RenderFunction;
+12
View File
@@ -0,0 +1,12 @@
/// <reference no-default-lib="true" />
/// <reference lib="dom" />
/// <reference lib="dom.iterable" />
/// <reference lib="dom.asynciterable" />
/// <reference lib="deno.ns" />
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" });