Skip to content

Commit 359c9e5

Browse files
committed
chore(nitro): clean up nitro template
1 parent 033add5 commit 359c9e5

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

templates/nitro/bun.lock

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

templates/nitro/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
"preview": "vite preview"
1010
},
1111
"dependencies": {
12-
"@ilha/router": "https://pkg.pr.new/ilhajs/ilha/@ilha/router@31dcb96",
13-
"ilha": "https://pkg.pr.new/ilhajs/ilha@31dcb96",
12+
"@ilha/router": "https://pkg.pr.new/ilhajs/ilha/@ilha/router@033add5",
13+
"ilha": "https://pkg.pr.new/ilhajs/ilha@033add5",
1414
"nitro": "^3.0.260311-beta"
1515
},
1616
"devDependencies": {

templates/nitro/src/pages/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@ import ilha, { html, raw } from "ilha";
33
export default ilha
44
.state("name", "Alice")
55
.derived("greeting", async ({ state, signal }) => {
6-
const req = await fetch(`http://192.168.64.2:3000/islands/hello?name=${state.name()}`, {
6+
if (import.meta.env.SSR) return "";
7+
const req = await fetch(`/islands/hello?name=${state.name()}`, {
78
signal,
89
});
910
return req.text();
1011
})
1112
.bind("#name", "name")
1213
.render(
13-
({ state, derived }) => html`
14+
({ derived }) => html`
1415
<section>
1516
<h1>Home</h1>
1617
<p>Welcome to Ilha.</p>
1718
<input id="name" type="text" />
18-
<p>${state.name()}</p>
1919
${raw(derived.greeting.value ?? "")}
2020
</section>
2121
`,

0 commit comments

Comments
 (0)