Skip to content
Myr

chore: update example (#123)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Yusuke Wada · committed by GitHub · parent 9d41d00 · Browse files · 10 files+24 added−33 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

10 files+24 added−33 removed

  • other:+24 added−33 removed

10 files+24 added−33 removed

modified:examples/basic/package.json+2 added-2 removed
modified:examples/basic/wrangler.toml+2 added-5 removed
modified:examples/blog/src/controller.ts+2 added-3 removed
modified:examples/blog/package.json+3 added-4 removed
modified:examples/durable-objects/src/index.ts+2 added-2 removed
modified:examples/durable-objects/package.json+3 added-3 removed
modified:examples/jsx-ssr/src/index.tsx+2 added-6 removed
20 unmodified lines
21 { id: '5', title: 'こんにちは', body: '昼からビールを飲みます' },22]2324// Logic25const getPosts = () => {26 return posts27}25const getPosts = () => posts2627const getPost = (id: string) => {28 return posts.find((post) => post.id == id)29}
7 unmodified lines
3738app.get('/post/:id{[0-9]+}', (c) => {39 const id = c.req.param('id')40 const post = getPost(id)43 if (!post) {44 return c.text('Not Found', 404)45 }41 if (!post) return c.notFound()42 const html = render(<Page post={post} />)43 return c.html(html)44})45
1 unmodified line
modified:examples/jsx-ssr/package.json+4 added-4 removed
modified:examples/mustache/package.json+2 added-2 removed
7 unmodified lines
8 "publish": "wrangler publish src/index.js"9 },10 "license": "MIT",11 "dependencies": {12 "hono": "^0.3.7",12 "hono": "^0.5.1",13 "mustache": "^4.2.0"14 },15 "devDependencies": {16 "wrangler": "^0.0.16"17 }18}18}
modified:examples/serve-static/package.json+2 added-2 removed
8 unmodified lines
9 "publish": "wrangler publish src/index.js"10 },11 "license": "MIT",12 "dependencies": {13 "hono": "^0.3.7"13 "hono": "^0.5.1"14 },15 "devDependencies": {16 "wrangler": "^0.0.16"17 }18}18}