From 767e6816407625a35e40000706202a5814cc8df4 Mon Sep 17 00:00:00 2001 From: Seth Trowbridge Date: Thu, 6 Apr 2023 23:44:27 -0400 Subject: [PATCH] #8 render title --- deno.json | 2 +- server.tsx | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/deno.json b/deno.json index 9f5a0c2..6ca1e43 100644 --- a/deno.json +++ b/deno.json @@ -14,6 +14,6 @@ "install": "deno install -f -A --unstable --no-lock -n eno server.tsx", "run": "deno run -A --unstable --no-lock server.tsx", "host": "deno run -A --unstable https://deno.land/std@0.181.0/http/file_server.ts", - "complete": "deno task host & cd example && pwd && deno task dev" + "example": "cd example && pwd && deno task dev" } } \ No newline at end of file diff --git a/server.tsx b/server.tsx index 5f73a2f..1e7380a 100644 --- a/server.tsx +++ b/server.tsx @@ -4,6 +4,7 @@ import { debounce } from "https://deno.land/std@0.151.0/async/debounce.ts"; import SSR from "https://esm.sh/v113/preact-render-to-string@6.0.2"; import * as Twind from "https://esm.sh/@twind/core@1.1.3"; import React, {JSX, createElement as h} from "react"; +import * as Iso from "@eno/iso"; const Transpiled = new Map(); const Transpileable =(inFilePath:string):boolean=> @@ -233,9 +234,11 @@ FileListen("${url.pathname}", reloadHandler);`; type = `text/html`; body = ` - + + ${Iso.Meta.title} + @@ -253,7 +256,7 @@ FileListen("${url.pathname}", reloadHandler);`; `; } - return new Response(body, {headers:{"content-type":type as string, "Access-Control-Allow-Origin":"*"}}); + return new Response(body, {headers:{"content-type":type as string, "Access-Control-Allow-Origin":"*", charset:"utf-8"}}); } catch(error) {