Skip to content
This repository was archived by the owner on Jul 6, 2025. It is now read-only.

Commit 9f7e65d

Browse files
author
ije
committed
v0.2.23
1 parent 3790a33 commit 9f7e65d

File tree

5 files changed

+17
-30
lines changed

5 files changed

+17
-30
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ The React Framework in [Deno](https://deno.land), inspired by [Next.js](https://
2323

2424
### Installation
2525
```bash
26-
deno install -A -f -n aleph https://deno.land/x/[email protected].22/cli.ts
26+
deno install -A -f -n aleph https://deno.land/x/[email protected].23/cli.ts
2727
```
2828

2929
### Usage

egg.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "aleph",
3-
"version": "0.2.22",
3+
"version": "0.2.23",
44
"description": "The React Framework in Deno.",
55
"homepage": "https://alephjs.org",
66
"repository": "https://github.com/alephjs/aleph.js",

examples/hello-world/api/hi.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import type { APIRequest } from "https://deno.land/x/aleph/types.ts"
2+
3+
export default function handler(req: APIRequest) {
4+
req.status(200).json({ name: 'Carol' })
5+
}

examples/hello-world/pages/index.tsx

Lines changed: 9 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,16 @@
11
import { Import, useDeno } from 'https://deno.land/x/aleph/mod.ts'
22
import React, { useState } from 'https://esm.sh/react'
33
import Logo from '../components/logo.tsx'
4+
import useSWR from "https://esm.sh/swr"
5+
import Axios from "https://esm.sh/axios";
6+
7+
const fetcher = (url: string) => Axios.get(url).then(({ data }) => data);
48

59
export default function Home() {
6-
const [count, setCount] = useState(0)
7-
const version = useDeno(() => {
8-
return Deno.version
9-
})
10+
const { data } = useSWR('/api/hi', fetcher);
1011

11-
return (
12-
<div className="page">
13-
<Import from="../style/index.less" />
14-
<p className="logo"><Logo /></p>
15-
<h1>Welcome to use <strong>Aleph.js</strong>!</h1>
16-
<p className="links">
17-
<a href="https://alephjs.org" target="_blank">Website</a>
18-
<span>&middot;</span>
19-
<a href="https://alephjs.org/docs/get-started" target="_blank">Get Started</a>
20-
<span>&middot;</span>
21-
<a href="https://alephjs.org/docs" target="_blank">Docs</a>
22-
<span>&middot;</span>
23-
<a href="https://github.com/alephjs/aleph.js" target="_blank">Github</a>
24-
</p>
25-
<p className="counter">
26-
<span>Counter:</span>
27-
<strong>{count}</strong>
28-
<button onClick={() => setCount(n => n - 1)}>-</button>
29-
<button onClick={() => setCount(n => n + 1)}>+</button>
30-
</p>
31-
<p className="copyinfo">Built by Aleph.js in Deno v{version.deno}</p>
32-
</div>
33-
)
12+
if (!data) {
13+
return <div>loading...</div>
14+
}
15+
return <div>hello {data.name}!</div>
3416
}

version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export const version = '0.2.22'
1+
export const version = '0.2.23'

0 commit comments

Comments
 (0)