diff --git a/fastapi-python/main.py b/fastapi-python/main.py index ac14cd2..af6d4c4 100644 --- a/fastapi-python/main.py +++ b/fastapi-python/main.py @@ -11,8 +11,8 @@ class Transfer(BaseModel): app = FastAPI() accounts = { - '1': 1000, - '2': 1000, + '1': {'amount': 1000}, + '2': {'amount': 1000}, } transactions: list[Transfer] = [] diff --git a/go-stdlib/main.go b/go-stdlib/main.go index 7c5952f..a0c4f01 100644 --- a/go-stdlib/main.go +++ b/go-stdlib/main.go @@ -13,9 +13,13 @@ type Transfer struct { Receiver int `json:"receiver"` } -var accounts = map[int]int{ - 1: 1000, - 2: 1000, +type Account struct { + Amount int `json:"amount"` +} + +var accounts = map[int]Account{ + 1: {Amount: 1000}, + 2: {Amount: 1000}, } var transactions = []Transfer{} diff --git a/hono/src/index.ts b/hono/src/index.ts index 0ed3340..e1574ff 100644 --- a/hono/src/index.ts +++ b/hono/src/index.ts @@ -31,6 +31,6 @@ app.post('/transfer', async (c) => { serve({ fetch: app.fetch, port: 3000 -}, (info) => { - console.log(`Server is running on http://localhost:${info.port}`) +}, (server) => { + console.log(`Server is running on http://localhost:${server.port}`) })