From 6831948476003527e5ac7eec0f1efa279bac2ac3 Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Mon, 7 Feb 2022 14:40:02 +0200 Subject: Add db conn --- src/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/index.ts b/src/index.ts index dac8807..c5cf39a 100644 --- a/src/index.ts +++ b/src/index.ts @@ -23,8 +23,9 @@ app timestamp: { format: "YYYY-MM-DDTHH:mm:ssZ" }, })) .get(ExampleApi.ListRequest.path, async (_req, res) => { + const examples: ExampleApi.Example[] = await client.query("SELECT * FROM examples").then(r => r.rows) const response: ExampleApi.ListResponse.Body = { - examples: [{ id: "123", title: "foobar", content: "10 20 + ." }], + examples, } res.send(response) }) -- cgit v1.3