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

Commit 0f2713f

Browse files
committed
Restore hello-world exmaple
1 parent da7d7ed commit 0f2713f

File tree

2 files changed

+3
-15
lines changed

2 files changed

+3
-15
lines changed

examples/hello-world/api/counter/data.json

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,6 @@
1-
import type { APIHandler, APIContext } from 'aleph/types.d.ts'
2-
import data from './data.json'
1+
import type { APIHandler } from 'aleph/types.d.ts'
32

4-
const create = async (
5-
{ response }: APIContext,
6-
db: string,
7-
) => {
3+
export const handler: APIHandler = ({ response }) => {
84
const count = parseInt(localStorage.getItem('count') || '0')
9-
response.json({ count, db: db, data })
5+
response.json({ count })
106
}
11-
12-
const requestWithMongo = (handler: typeof create): APIHandler =>
13-
async (context) => {
14-
await handler(context, "mongo")
15-
}
16-
17-
export const handler: APIHandler = requestWithMongo(create)

0 commit comments

Comments
 (0)