mirror of
https://gitlab.massbug.com/massbug/judge4c.git
synced 2025-07-04 10:42:15 +00:00
feat(auth): implement auth API routes
This commit is contained in:
parent
2a126e496b
commit
66deafc4fb
17
src/features/auth/server/route.ts
Normal file
17
src/features/auth/server/route.ts
Normal file
@ -0,0 +1,17 @@
|
||||
import { Hono } from "hono";
|
||||
import { zValidator } from "@hono/zod-validator";
|
||||
import { loginSchema, registerSchema } from "../schema";
|
||||
|
||||
const app = new Hono()
|
||||
.post("/login", zValidator("json", loginSchema), async (c) => {
|
||||
const { email, password } = c.req.valid("json");
|
||||
console.log({ email, password });
|
||||
return c.json({ email, password });
|
||||
})
|
||||
.post("/register", zValidator("json", registerSchema), async (c) => {
|
||||
const { name, email, password } = c.req.valid("json");
|
||||
console.log({ name, email, password });
|
||||
return c.json({ name, email, password });
|
||||
});
|
||||
|
||||
export default app;
|
Loading…
Reference in New Issue
Block a user