Compare commits
No commits in common. "f5d7ca2e95590e34b5f6fae0448c1d796e0e0c63" and "d3f08a67a09733f8b32e0136330ffe05acc484ec" have entirely different histories.
f5d7ca2e95
...
d3f08a67a0
13
circ/a.tsx
13
circ/a.tsx
@ -1,13 +0,0 @@
|
||||
import { doSomething } from './b.tsx';
|
||||
|
||||
export function doSomethingElse() {
|
||||
|
||||
if(Deno.env.get("a") && Deno.env.get("b")){return;}
|
||||
|
||||
Deno.env.set("a", "called");
|
||||
console.log("a action");
|
||||
|
||||
doSomething();
|
||||
}
|
||||
|
||||
import.meta.main
|
22
circ/b.tsx
22
circ/b.tsx
@ -1,22 +0,0 @@
|
||||
import * as mod from "https://deno.land/std@0.185.0/path/mod.ts";
|
||||
import { doSomethingElse } from './a.tsx';
|
||||
|
||||
export function doSomething() {
|
||||
|
||||
const pathInit = Deno.mainModule;
|
||||
|
||||
const pathProj = mod.toFileUrl(Deno.cwd());
|
||||
|
||||
console.log(pathInit);
|
||||
console.log(import.meta.url);
|
||||
|
||||
console.log(pathInit.split(pathProj));
|
||||
|
||||
console.log("b main?", Deno.mainModule);
|
||||
console.log("deno main?", Deno.cwd());
|
||||
|
||||
|
||||
Deno.env.set("b", "called");
|
||||
console.log("b action");
|
||||
doSomethingElse();
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
import { doSomethingElse } from "./a.tsx";
|
||||
|
||||
doSomethingElse();
|
@ -4,8 +4,9 @@
|
||||
]},
|
||||
"imports": {
|
||||
"react": "https://esm.sh/preact@10.13.2/compat",
|
||||
"preact": "https://esm.sh/preact@10.13.2/compat",
|
||||
|
||||
"react-original": "https://esm.sh/preact@10.13.2/compat",
|
||||
"@eno/app": "./example/app.tsx",
|
||||
"@eno/iso": "./lib/iso.tsx"
|
||||
},
|
||||
"tasks":
|
||||
|
@ -3,36 +3,34 @@ import * as Iso from "@eno/iso";
|
||||
|
||||
const Comp = React.lazy(()=>import("./deep/component.tsx"));
|
||||
|
||||
Iso.Boot(
|
||||
()=>
|
||||
{
|
||||
return <div class="p-4 font-sans">
|
||||
<Iso.Meta.Metas title="Main Page!"/>
|
||||
<nav class="p-4">
|
||||
<a class="text-red-500" href="/">Home</a>
|
||||
<a href="/about">About</a>
|
||||
</nav>
|
||||
|
||||
<h1 class="my-2 font(bold serif) text(3xl)">Title!!!!!!</h1>
|
||||
<h2>suspended:</h2>
|
||||
<React.Suspense fallback={<div>Loading!</div>}>
|
||||
<Comp/>
|
||||
</React.Suspense>
|
||||
<Iso.Switch>
|
||||
<Iso.Case value="page">
|
||||
<Iso.Switch>
|
||||
<Iso.Case value="about-us">
|
||||
<>
|
||||
<Iso.Meta.Metas title="About US"/>
|
||||
About us!
|
||||
</>
|
||||
</Iso.Case>
|
||||
<Iso.Case default>sorry no page</Iso.Case>
|
||||
</Iso.Switch>
|
||||
</Iso.Case>
|
||||
<Iso.Case value="lol/idk">lol/idk</Iso.Case>
|
||||
<Iso.Case default><p>404!</p></Iso.Case>
|
||||
</Iso.Switch>
|
||||
</div>;
|
||||
}
|
||||
);
|
||||
export default ()=>
|
||||
{
|
||||
return <div class="p-4 font-sans">
|
||||
<Iso.Meta.Metas title="Main Page!"/>
|
||||
<nav class="p-4">
|
||||
<a class="text-red-500" href="/">Home</a>
|
||||
<a href="/about">About</a>
|
||||
</nav>
|
||||
|
||||
<h1 class="my-2 font(bold serif) text(3xl)">Title!!</h1>
|
||||
<h2>suspended:</h2>
|
||||
<React.Suspense fallback={<div>Loading!</div>}>
|
||||
<Comp/>
|
||||
</React.Suspense>
|
||||
<Iso.Switch>
|
||||
<Iso.Case value="page">
|
||||
<Iso.Switch>
|
||||
<Iso.Case value="about-us">
|
||||
<>
|
||||
<Iso.Meta.Metas title="About US"/>
|
||||
About us!
|
||||
</>
|
||||
</Iso.Case>
|
||||
<Iso.Case default>sorry no page</Iso.Case>
|
||||
</Iso.Switch>
|
||||
</Iso.Case>
|
||||
<Iso.Case value="lol/idk">lol/idk</Iso.Case>
|
||||
<Iso.Case default><p>404!</p></Iso.Case>
|
||||
</Iso.Switch>
|
||||
</div>;
|
||||
};
|
@ -5,9 +5,10 @@
|
||||
"react": "https://esm.sh/stable/preact@10.13.2/compat",
|
||||
"preact": "https://esm.sh/stable/preact@10.13.2/",
|
||||
"@deep/": "./deep/",
|
||||
"@eno/app": "./app.tsx",
|
||||
"@eno/iso": "http://localhost:4507/lib/iso.tsx"
|
||||
},
|
||||
"tasks": {
|
||||
"dev": "deno run -A --unstable --reload=http://localhost:4507/ --no-lock app.tsx"
|
||||
"dev": "deno run -A --unstable --reload=http://localhost:4507/ --no-lock app.tsx --dev"
|
||||
}
|
||||
}
|
@ -1,30 +0,0 @@
|
||||
import React, {hydrate} from "react";
|
||||
import * as Twind from "https://esm.sh/v115/@twind/core@1.1.3/es2022/core.mjs";
|
||||
import {Router, CSS, Meta} from "@eno/iso";
|
||||
|
||||
export function Boot(inApp:()=>React.JSX.Element, inCSS?:object)
|
||||
{
|
||||
console.log(inApp, inCSS);
|
||||
Twind.install(inCSS ? {...CSS, ...inCSS} : CSS);
|
||||
|
||||
const HMRWrap =()=> React.createElement(inApp, null, null);
|
||||
|
||||
const root = document.querySelector("#app");
|
||||
|
||||
if(root)
|
||||
{
|
||||
hydrate(
|
||||
<Router.Provider url={new URL(window.location.href)}>
|
||||
<Meta.Provider>
|
||||
<HMRWrap/>
|
||||
</Meta.Provider>
|
||||
</Router.Provider>,
|
||||
root
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
console.log(`no "#app" element is present!`)
|
||||
}
|
||||
|
||||
};
|
10
lib/iso.tsx
10
lib/iso.tsx
@ -1,24 +1,16 @@
|
||||
import TWPreTail from "https://esm.sh/v115/@twind/preset-tailwind@1.1.4/es2022/preset-tailwind.mjs";
|
||||
import TWPreAuto from "https://esm.sh/v115/@twind/preset-autoprefix@1.0.7/es2022/preset-autoprefix.mjs";
|
||||
import React from "react";
|
||||
import { Boot as _Boot } from "../server.tsx";
|
||||
|
||||
export const CSS = {
|
||||
presets: [TWPreTail(), TWPreAuto()],
|
||||
hash:false
|
||||
};
|
||||
/*
|
||||
|
||||
if(!window.innerWidth)
|
||||
{
|
||||
import(import.meta.resolve("../../server.tsx")).then(()=>{console.log("...imported!");});
|
||||
}
|
||||
*/
|
||||
|
||||
export function Boot(inApp:React.FunctionComponent, inCSS?:object)
|
||||
{
|
||||
_Boot(inApp, inCSS);
|
||||
}
|
||||
|
||||
|
||||
type MetasInputs = { [Property in MetaKeys]?: string };
|
||||
type MetasModeArgs = {concatListed?:boolean; dropUnlisted?:boolean};
|
||||
|
319
server.tsx
319
server.tsx
@ -2,13 +2,14 @@ import * as ESBuild from 'https://deno.land/x/esbuild@v0.17.4/mod.js';
|
||||
import * as MIME from "https://deno.land/std@0.180.0/media_types/mod.ts";
|
||||
import { debounce } from "https://deno.land/std@0.151.0/async/debounce.ts";
|
||||
import { parse as JSONC} from "https://deno.land/std@0.185.0/jsonc/mod.ts";
|
||||
import { toFileUrl } from "https://deno.land/std@0.185.0/path/mod.ts";
|
||||
import SSR from "https://esm.sh/v113/preact-render-to-string@6.0.2";
|
||||
import Prepass from "https://esm.sh/preact-ssr-prepass@1.2.0";
|
||||
import * as Twind from "https://esm.sh/@twind/core@1.1.3";
|
||||
import React from "react";
|
||||
import * as Iso from "@eno/iso";
|
||||
|
||||
Deno.env.set("initialized", "true");
|
||||
|
||||
/**
|
||||
* Setup a transpiler.
|
||||
* @param inDevMode When true, starts a file-watcher
|
||||
@ -133,7 +134,6 @@ function Transpiler(inDevMode:boolean)
|
||||
|
||||
}
|
||||
|
||||
type ImportMap = {imports?:Record<string, string>, importMap?:string};
|
||||
/**
|
||||
* Extract all configuration info form a project's deno.jsonc file
|
||||
* @param inDevMode When true, proxies react to an HMR-enabled version
|
||||
@ -142,7 +142,8 @@ type ImportMap = {imports?:Record<string, string>, importMap?:string};
|
||||
*/
|
||||
async function Configure(inDevMode:boolean, inLibPath:string)
|
||||
{
|
||||
const output:{Imports?:ImportMap, Error?:string} = {};
|
||||
type ImportMap = {imports?:Record<string, string>, importMap?:string};
|
||||
const output:{Imports?:ImportMap, App?:React.FunctionComponent, TwindInst?:Twind.Twind, Error?:string} = {};
|
||||
let ImportObject:ImportMap = {};
|
||||
try
|
||||
{
|
||||
@ -203,6 +204,52 @@ async function Configure(inDevMode:boolean, inLibPath:string)
|
||||
return output;
|
||||
}
|
||||
|
||||
const importApp = output.Imports.imports["@eno/app"];
|
||||
if(importApp)
|
||||
{
|
||||
let appImport
|
||||
try
|
||||
{
|
||||
appImport = await import(Path.Active+importApp);
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
output.Error = `"@eno/app" entry-point (${importApp}) file not found`;
|
||||
return output;
|
||||
}
|
||||
|
||||
if(typeof appImport.default == "function" )
|
||||
{
|
||||
output.App = appImport.default;
|
||||
}
|
||||
else
|
||||
{
|
||||
output.Error = `"@eno/app" entry-point (${importApp}) needs to export a default function to use as the app root.`;
|
||||
return output;
|
||||
}
|
||||
|
||||
let twindConfig = Iso.CSS;
|
||||
if(typeof appImport.CSS == "object")
|
||||
{
|
||||
twindConfig = {...twindConfig, ...appImport.CSS};
|
||||
}
|
||||
try
|
||||
{
|
||||
// @ts-ignore
|
||||
output.TwindInst = Twind.install(twindConfig);
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
output.Error = `CSS configuration is malformed`;
|
||||
return output;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
output.Error = `"imports" configuration does not alias an entry-point file as "@eno/app"`;
|
||||
return output;
|
||||
}
|
||||
|
||||
|
||||
Object.entries(output.Imports.imports).forEach(([key, value])=>{
|
||||
if(value.startsWith("./") && output.Imports?.imports)
|
||||
@ -225,178 +272,158 @@ async function Configure(inDevMode:boolean, inLibPath:string)
|
||||
return output;
|
||||
}
|
||||
|
||||
const Flags:Record<string, string|boolean> = {};
|
||||
Deno.args.forEach(arg=>
|
||||
{
|
||||
if(arg.startsWith("--"))
|
||||
{
|
||||
const kvp = arg.substring(2).split("=");
|
||||
Deno.env.set(kvp[0], kvp[1] ? kvp[1] : "true");
|
||||
Flags[kvp[0]] = kvp[1] ? kvp[1] : true;
|
||||
}
|
||||
});
|
||||
|
||||
let DevMode = Deno.env.get("dev") ? true : false;
|
||||
let DevMode = Flags.dev ? true : false;
|
||||
let hosted = import.meta.resolve("./");
|
||||
const Path = {
|
||||
Hosted: hosted.substring(0, hosted.length-1),
|
||||
Active: `file://${Deno.cwd().replaceAll("\\", "/")}`,
|
||||
LibDir: "lib",
|
||||
AppDir: ""
|
||||
LibDir: "lib"
|
||||
};
|
||||
console.log(Path);
|
||||
console.log(`Dev Mode: ${DevMode}`);
|
||||
console.log(`Args seen: `, Deno.env.toObject);
|
||||
console.log(`Args seen: `, Flags);
|
||||
|
||||
|
||||
let Booted = false;
|
||||
let TwindInst:Twind.Twind;
|
||||
export function Boot(inApp:React.FunctionComponent, inCSS?:object)
|
||||
const {Transpileable, TranspileURL, SocketsHandler} = Transpiler(DevMode);
|
||||
const {Imports, App, TwindInst, Error} = await Configure(DevMode, Path.LibDir);
|
||||
if(Error)
|
||||
{
|
||||
if(Booted){return;}
|
||||
Booted = true;
|
||||
|
||||
const pathInit = Deno.mainModule;
|
||||
const pathProj = toFileUrl(Deno.cwd());
|
||||
|
||||
//@ts-ignore
|
||||
TwindInst = Twind.install({...Iso.CSS, ...inCSS||{}});
|
||||
|
||||
const App = inApp;
|
||||
Path.AppDir = pathInit.split(pathProj.toString())[1];
|
||||
|
||||
Server(App, Path.AppDir, TwindInst);
|
||||
console.log(Error);
|
||||
}
|
||||
|
||||
async function Server(App:React.FunctionComponent, AppPath:string, TwindInst:Twind.Twind)
|
||||
else if(App && TwindInst)
|
||||
{
|
||||
const {Transpileable, TranspileURL, SocketsHandler} = Transpiler(DevMode);
|
||||
const {Imports, Error} = await Configure(DevMode, Path.LibDir);
|
||||
if(Error)
|
||||
Deno.serve({ port: Flags?.port||3000 }, async(_req:Request) =>
|
||||
{
|
||||
console.log(Error);
|
||||
}
|
||||
else if(App && TwindInst)
|
||||
{
|
||||
Deno.serve({ port: Deno.env.get("port")||3000 }, async(_req:Request) =>
|
||||
{
|
||||
const url:URL = new URL(_req.url);
|
||||
const pathParts = url.pathname.substring(1, url.pathname.endsWith("/") ? url.pathname.length-1 : url.pathname.length).split("/");
|
||||
const pathLast = pathParts.at(-1);
|
||||
const pathExt:string|undefined = pathLast?.split(".")[1];
|
||||
|
||||
const resp = SocketsHandler(_req);
|
||||
if(resp){ return resp; }
|
||||
const url:URL = new URL(_req.url);
|
||||
const pathParts = url.pathname.substring(1, url.pathname.endsWith("/") ? url.pathname.length-1 : url.pathname.length).split("/");
|
||||
const pathLast = pathParts.at(-1);
|
||||
const pathExt:string|undefined = pathLast?.split(".")[1];
|
||||
|
||||
console.log(url.pathname);
|
||||
|
||||
try
|
||||
const resp = SocketsHandler(_req);
|
||||
if(resp){ return resp; }
|
||||
|
||||
try
|
||||
{
|
||||
// serve index by default
|
||||
let type = `text/html`;
|
||||
let body:BodyInit = ``;
|
||||
|
||||
const isLib = url.pathname.startsWith(`/${Path.LibDir}/`);
|
||||
|
||||
if(Transpileable(url.pathname))
|
||||
{
|
||||
// serve index by default
|
||||
let type = `text/html`;
|
||||
let body:BodyInit = ``;
|
||||
|
||||
const isLib = url.pathname.startsWith(`/${Path.LibDir}/`);
|
||||
|
||||
if(Transpileable(url.pathname))
|
||||
type = `application/javascript`;
|
||||
if(isLib)
|
||||
{
|
||||
type = `application/javascript`;
|
||||
if(isLib)
|
||||
{
|
||||
body = await TranspileURL(Path.Hosted+url.pathname, url.pathname, true);
|
||||
}
|
||||
else if(url.pathname == "/server.tsx")
|
||||
{
|
||||
body = await TranspileURL(`${Path.Hosted}/${Path.LibDir}/boot-client.tsx`, url.pathname, true);
|
||||
}
|
||||
else if(DevMode && !url.searchParams.get("reload"))
|
||||
{
|
||||
const imp = await import(Path.Active+url.pathname);
|
||||
const members = [];
|
||||
for( const key in imp ) { members.push(key); }
|
||||
body =
|
||||
`
|
||||
import {FileListen} from "/${Path.LibDir}/hmr.tsx";
|
||||
import * as Import from "${url.pathname}?reload=0";
|
||||
${ members.map(m=>`let proxy_${m} = Import.${m};
|
||||
export { proxy_${m} as ${m} };
|
||||
`).join(" ") }
|
||||
const reloadHandler = (updatedModule)=>
|
||||
{
|
||||
${ members.map(m=>`proxy_${m} = updatedModule.${m};`).join("\n") }
|
||||
};
|
||||
FileListen("${url.pathname}", reloadHandler);`;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
body = await TranspileURL(Path.Active+url.pathname, url.pathname, true);
|
||||
}
|
||||
body = await TranspileURL(Path.Hosted+url.pathname, url.pathname, true);
|
||||
}
|
||||
// serve static media
|
||||
else if( pathExt )
|
||||
else if(DevMode && !url.searchParams.get("reload"))
|
||||
{
|
||||
type = MIME.typeByExtension(pathExt) || "text/html";
|
||||
const _fetch = await fetch((Path.Active)+url.pathname);
|
||||
body = await _fetch.text();
|
||||
const imp = await import(Path.Active+url.pathname);
|
||||
const members = [];
|
||||
for( const key in imp ) { members.push(key); }
|
||||
body =
|
||||
`
|
||||
import {FileListen} from "/${Path.LibDir}/hmr.tsx";
|
||||
import * as Import from "${url.pathname}?reload=0";
|
||||
${ members.map(m=>`let proxy_${m} = Import.${m};
|
||||
export { proxy_${m} as ${m} };
|
||||
`).join(" ") }
|
||||
const reloadHandler = (updatedModule)=>
|
||||
{
|
||||
${ members.map(m=>`proxy_${m} = updatedModule.${m};`).join("\n") }
|
||||
};
|
||||
FileListen("${url.pathname}", reloadHandler);`;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
Iso.Fetch.ServerBlocking = [];
|
||||
Iso.Fetch.ServerTouched = new Set();
|
||||
Iso.Fetch.ServerRemove = new Set();
|
||||
let app = <Iso.Router.Provider url={url}><Iso.Meta.Provider><App/></Iso.Meta.Provider></Iso.Router.Provider>;
|
||||
await Prepass(app)
|
||||
let bake = SSR(app);
|
||||
while(Iso.Fetch.ServerBlocking.length)
|
||||
{
|
||||
await Promise.all(Iso.Fetch.ServerBlocking);
|
||||
Iso.Fetch.ServerBlocking = [];
|
||||
// at this point, anything that was requested that was not cached, has now been loaded and cached
|
||||
// this next render will use cached resources. using a cached resource (if its "Seed" is true) adds it to the "touched" set.
|
||||
app = <Iso.Router.Provider url={url}><Iso.Meta.Provider><App/></Iso.Meta.Provider></Iso.Router.Provider>;
|
||||
await Prepass(app)
|
||||
bake = SSR(app);
|
||||
}
|
||||
|
||||
const seed:Iso.FetchRecord[] = [];
|
||||
Iso.Fetch.ServerTouched.forEach((record)=>{
|
||||
const r:Iso.FetchRecord = {...record};
|
||||
delete r.Promise;
|
||||
seed.push(r);
|
||||
});
|
||||
Iso.Fetch.ServerTouched = false;
|
||||
|
||||
const results = Twind.extract(bake, TwindInst);
|
||||
|
||||
type = `text/html`;
|
||||
body =
|
||||
`<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>${Iso.Meta.Meta.title}</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta charset="utf-8"/>
|
||||
<style data-twind>${results.css}</style>
|
||||
<script type="importmap">${JSON.stringify(Imports)}</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app">${results.html}</div>
|
||||
<script type="module">
|
||||
import {Fetch} from "@eno/iso";
|
||||
Fetch.Seed(${JSON.stringify(seed)});
|
||||
|
||||
import "${AppPath}";
|
||||
</script>
|
||||
</body>
|
||||
</html>`;
|
||||
body = await TranspileURL(Path.Active+url.pathname, url.pathname, true);
|
||||
}
|
||||
|
||||
return new Response(body, {headers:{"content-type":type as string, "Access-Control-Allow-Origin":"*", charset:"utf-8"}});
|
||||
}
|
||||
catch(error)
|
||||
// serve static media
|
||||
else if( pathExt )
|
||||
{
|
||||
console.log(error);
|
||||
return new Response(error, {status:404});
|
||||
type = MIME.typeByExtension(pathExt) || "text/html";
|
||||
const _fetch = await fetch((Path.Active)+url.pathname);
|
||||
body = await _fetch.text();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Iso.Fetch.ServerBlocking = [];
|
||||
Iso.Fetch.ServerTouched = new Set();
|
||||
Iso.Fetch.ServerRemove = new Set();
|
||||
let app = <Iso.Router.Provider url={url}><App/></Iso.Router.Provider>;
|
||||
await Prepass(app)
|
||||
let bake = SSR(app);
|
||||
while(Iso.Fetch.ServerBlocking.length)
|
||||
{
|
||||
await Promise.all(Iso.Fetch.ServerBlocking);
|
||||
Iso.Fetch.ServerBlocking = [];
|
||||
// at this point, anything that was requested that was not cached, has now been loaded and cached
|
||||
// this next render will use cached resources. using a cached resource (if its "Seed" is true) adds it to the "touched" set.
|
||||
app = <Iso.Router.Provider url={url}><App/></Iso.Router.Provider>;
|
||||
await Prepass(app)
|
||||
bake = SSR(app);
|
||||
}
|
||||
|
||||
const seed:Iso.FetchRecord[] = [];
|
||||
Iso.Fetch.ServerTouched.forEach((record)=>{
|
||||
const r:Iso.FetchRecord = {...record};
|
||||
delete r.Promise;
|
||||
seed.push(r);
|
||||
});
|
||||
Iso.Fetch.ServerTouched = false;
|
||||
|
||||
const results = Twind.extract(bake, TwindInst);
|
||||
|
||||
type = `text/html`;
|
||||
body =
|
||||
`<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>${Iso.Meta.Meta.title}</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta charset="utf-8"/>
|
||||
<style data-twind>${results.css}</style>
|
||||
<script type="importmap">${JSON.stringify(Imports)}</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app">${results.html}</div>
|
||||
<script type="module">
|
||||
import {hydrate, createElement as H} from "react";
|
||||
import * as Twind from "https://esm.sh/v115/@twind/core@1.1.3/es2022/core.mjs";
|
||||
import * as App from "@eno/app";
|
||||
import {Router, Fetch, CSS, Meta} from "@eno/iso";
|
||||
Twind.install(App.CSS ? {...CSS, ...App.CSS} : CSS);
|
||||
Fetch.Seed(${JSON.stringify(seed)});
|
||||
const hmrWrap = H( ()=>H(App.default) );
|
||||
hydrate(
|
||||
H(Router.Provider, null,
|
||||
H(Meta.Provider, null, hmrWrap)
|
||||
),
|
||||
document.querySelector("#app")
|
||||
);
|
||||
</script>
|
||||
</body>
|
||||
</html>`;
|
||||
}
|
||||
|
||||
return new Response(body, {headers:{"content-type":type as string, "Access-Control-Allow-Origin":"*", charset:"utf-8"}});
|
||||
}
|
||||
catch(error)
|
||||
{
|
||||
console.log(error);
|
||||
return new Response(error, {status:404});
|
||||
}
|
||||
});
|
||||
}
|
Loading…
Reference in New Issue
Block a user