From 504f845f110118574db416150e94ed5735b24c0f Mon Sep 17 00:00:00 2001 From: Shav Kinderlehrer Date: Sun, 15 Oct 2023 02:55:58 -0400 Subject: Implement post --- src/index.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/index.ts') diff --git a/src/index.ts b/src/index.ts index 119ea91..f20fee6 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,15 +1,18 @@ import { Elysia } from "elysia"; import postgres from "postgres"; -import { get_home, get_id } from "./get"; +import { get_home, get_id, get_create } from "./get"; +import { post_c } from "./post"; const sql = postgres(); const app = new Elysia() .get("/", ({ headers }) => get_home({ headers: headers })) - .get("/:id", async ({ params, headers, }) => get_id( + .get("/:id", ({ params, headers, }) => get_id( { params: params, headers: headers }, sql) ) + .get("/c", () => get_create()) + .post("/c", ({ body }) => post_c(body, sql)) app.listen(3000) -- cgit v1.2.3