Unsmart | Tech debt
01/25/2023, 9:35 PMUnsmart | Tech debt
01/25/2023, 9:36 PMUnsmart | Tech debt
01/25/2023, 9:38 PMts
export class Limits implements DurableObject {
private app = new Hono<Bindings>()
constructor(private state: DurableObjectState, private env: Bindings) {
this.app.post('/', async c => {
try {
const requests = await this.state.storage.get<number>(`Requests`) ?? 0
await this.state.storage.put(`Requests`, requests + 1)
return c.json({ requests: requests + 1 })
} catch (error: any) {
return c.json({ error: error.message }, 500)
}
})
}
async fetch(request: Request) {
return this.app.fetch(request, this.env)
}
}
Lockface77
01/25/2023, 9:48 PMLockface77
01/25/2023, 9:48 PMUnsmart | Tech debt
01/25/2023, 9:52 PMLockface77
01/25/2023, 9:53 PMLockface77
01/25/2023, 9:53 PMUnsmart | Tech debt
01/25/2023, 9:53 PMJacob Wright
01/25/2023, 10:51 PMJacob Wright
01/25/2023, 10:54 PMJacob Wright
01/25/2023, 10:55 PMJacob Wright
01/25/2023, 11:01 PMJacob Wright
01/25/2023, 11:20 PMUnsmart | Tech debt
01/25/2023, 11:26 PMJacob Wright
01/25/2023, 11:27 PMUnsmart | Tech debt
01/26/2023, 1:13 AMLockface77
01/26/2023, 2:11 PMbrett
01/26/2023, 3:34 PMhannes
01/26/2023, 4:46 PMUnsmart | Tech debt
01/26/2023, 4:50 PMbrett
01/26/2023, 5:06 PMDanTheGoodman
01/26/2023, 10:28 PMaranchelk
01/26/2023, 10:31 PMDanTheGoodman
01/26/2023, 10:38 PMenv.{DO}
?Resonious
01/26/2023, 11:18 PMSkye
01/26/2023, 11:20 PM