feat: insert registry to head
This commit is contained in:
parent
bd66b1ccae
commit
325ecf36c6
3 changed files with 8 additions and 12 deletions
|
@ -10,6 +10,14 @@ export default eventHandler(async (event) => {
|
||||||
if (!html) html = await useStorage().getItem(fallback);
|
if (!html) html = await useStorage().getItem(fallback);
|
||||||
if (!html) html = await useStorage().getItem(getPath("/404.html"));
|
if (!html) html = await useStorage().getItem(getPath("/404.html"));
|
||||||
|
|
||||||
|
// insert registry to head
|
||||||
|
html = html
|
||||||
|
.toString()
|
||||||
|
.replace(
|
||||||
|
"</head>",
|
||||||
|
'<script type="module" src="./.output/registry.js"></script></head>'
|
||||||
|
);
|
||||||
|
|
||||||
return html ?? new Response("Not found", { status: 404 });
|
return html ?? new Response("Not found", { status: 404 });
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -1,11 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8" />
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
||||||
<title>About Me</title>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<h1>About Me</h1>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -4,7 +4,6 @@
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>Hello Nitro</title>
|
<title>Hello Nitro</title>
|
||||||
<script type="module" src="./.output/registry.js"></script>
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div>
|
<div>
|
||||||
|
|
Loading…
Reference in a new issue