Public
HTTP
todepond-getcloudlabcount.web.val.run
May 23, 2024
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import { blob } from "https://esm.town/v/std/blob";
import { sqlite } from "https://esm.town/v/std/sqlite";
// TODO: Convert to sqlite
export default async function(req: Request): Promise<Response> {
const result = await sqlite.execute(
"SELECT COUNT(*) FROM counter_2_baby",
);
const startingValue = 172243 - 211;
const count = result.rows[0][0] + startingValue;
return Response.json(count);
// const count = await blob.getJSON("lab-count") ?? 0;
// return Response.json(count);
}
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Comments
Nobody has commented on this val yet: be the first!
May 23, 2024