Skip to content

Commit 79d2e48

Browse files
committed
📘 doc: update to eden 0.6.1
1 parent 5c13ce1 commit 79d2e48

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

docs/plugins/eden/overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ import type { App } from './server'
4040
const app = edenTreaty<App>('http://localhost:8080')
4141

4242
// Call [GET] at '/'
43-
const { data, error } = app.index.get()
43+
const { data, error } = app.get()
4444

4545
// Call [POST] at '/nendoroid/id/:id'
4646
const { data: nendoroid, error } = await app.nendoroid.id['1895'].post({

docs/plugins/eden/treaty.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ import type { App } from './server'
4949
const app = edenTreaty<App>('http://localhost:8080')
5050

5151
// response type: 'Hi Elysia'
52-
const { data: pong, error } = app.index.get()
52+
const { data: pong, error } = app.get()
5353

5454
// response type: 1895
5555
const { data: id, error } = app.id['1895'].get()
@@ -81,8 +81,6 @@ Eden will transform `/` into `.` then can be called with `method` registered, fo
8181
- **/path** -> .path
8282
- **/nested/path** -> .nested.path
8383

84-
For `/`, will become `index` instead.
85-
8684
### Path parameters
8785
With path parameters, any name will be applicable and mapped to path parameters automatically.
8886

@@ -97,7 +95,7 @@ If a path doesn't support path parameter, TypeScript will throw an error.
9795
### Query
9896
You can append query to path with `$query`:
9997
```typescript
100-
app.index.get({
98+
app.get({
10199
$query: {
102100
name: 'Eden',
103101
code: 'Gold'
@@ -108,7 +106,7 @@ app.index.get({
108106
### Fetch
109107
Eden Treaty is a fetch wrapper, you can add any valid fetch's parameters to Eden by passing it to `$fetch`:
110108
```typescript
111-
app.index.post({
109+
app.post({
112110
$fetch: {
113111
headers: {
114112
'x-origanization': 'MANTIS'

0 commit comments

Comments
 (0)