aboutsummaryrefslogtreecommitdiff
path: root/src/index.ts
diff options
context:
space:
mode:
authorShav Kinderlehrer <[email protected]>2023-10-15 02:55:58 -0400
committerShav Kinderlehrer <[email protected]>2023-10-15 02:55:58 -0400
commit504f845f110118574db416150e94ed5735b24c0f (patch)
treef7b21fa2ff3f08fd203e92f57ded3ecd215dc3a4 /src/index.ts
parent96982b85e23af2a24841c3c44e598ae71f78abf6 (diff)
downloadurl-shortener-504f845f110118574db416150e94ed5735b24c0f.tar.gz
url-shortener-504f845f110118574db416150e94ed5735b24c0f.zip
Implement post
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)