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

Commit 967aecf

Browse files
committed
Update examples
1 parent 1baa679 commit 967aecf

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

examples/hello-world-spa/api/counter/[action].ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const store = globalThis as any
55
export default async function handler(req: APIRequest) {
66
let count = store.$count || 0
77

8-
switch (req.params.get('action')) {
8+
switch (req.params['action']) {
99
case 'increase':
1010
count++
1111
store.$count = count
@@ -20,7 +20,7 @@ export default async function handler(req: APIRequest) {
2020
req.status(400).json({
2121
error: 'UnknownAction',
2222
status: 400,
23-
message: `undefined action '${req.params.get('action')}'`
23+
message: `undefined action '${req.params['action']}'`
2424
})
2525
break
2626
}

examples/hello-world-src-dir/src/api/counter/[action].ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const store = globalThis as any
55
export default async function handler(req: APIRequest) {
66
let count = store.$count || 0
77

8-
switch (req.params.get('action')) {
8+
switch (req.params['action']) {
99
case 'increase':
1010
count++
1111
store.$count = count
@@ -20,7 +20,7 @@ export default async function handler(req: APIRequest) {
2020
req.status(400).json({
2121
error: 'UnknownAction',
2222
status: 400,
23-
message: `undefined action '${req.params.get('action')}'`
23+
message: `undefined action '${req.params['action']}'`
2424
})
2525
break
2626
}

examples/hello-world/api/counter/[action].ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const store = globalThis as any
55
export default async function handler(req: APIRequest) {
66
let count = store.$count || 0
77

8-
switch (req.params.get('action')) {
8+
switch (req.params['action']) {
99
case 'increase':
1010
count++
1111
store.$count = count
@@ -20,7 +20,7 @@ export default async function handler(req: APIRequest) {
2020
req.status(400).json({
2121
error: 'UnknownAction',
2222
status: 400,
23-
message: `undefined action '${req.params.get('action')}'`
23+
message: `undefined action '${req.params['action']}'`
2424
})
2525
break
2626
}

0 commit comments

Comments
 (0)