aboutsummaryrefslogtreecommitdiff
path: root/src/index.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/index.ts')
-rw-r--r--src/index.ts7
1 files changed, 5 insertions, 2 deletions
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)