diff options
| author | nsfisis <nsfisis@gmail.com> | 2025-12-03 05:28:29 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2025-12-04 23:26:25 +0900 |
| commit | 950217ed3ca93a0aa0e964c2a8474ffc13c71912 (patch) | |
| tree | f5a8575a74aa8203a8fd49846ab859670009ffd7 /pkgs/server/src/index.ts | |
| parent | 7e75e0fa8f26a7890c210c67e4474778811b15bc (diff) | |
| download | kioku-950217ed3ca93a0aa0e964c2a8474ffc13c71912.tar.gz kioku-950217ed3ca93a0aa0e964c2a8474ffc13c71912.tar.zst kioku-950217ed3ca93a0aa0e964c2a8474ffc13c71912.zip | |
feat(auth): add user registration endpoint
Implement POST /api/auth/register endpoint with:
- Argon2 password hashing
- Zod validation for username (1-255 chars) and password (8-255 chars)
- Duplicate username check (returns 409 Conflict)
- Returns created user with id, username, and createdAt
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Diffstat (limited to 'pkgs/server/src/index.ts')
| -rw-r--r-- | pkgs/server/src/index.ts | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/pkgs/server/src/index.ts b/pkgs/server/src/index.ts index a00c9fd..a0ae0a4 100644 --- a/pkgs/server/src/index.ts +++ b/pkgs/server/src/index.ts @@ -2,6 +2,7 @@ import { serve } from "@hono/node-server"; import { Hono } from "hono"; import { logger } from "hono/logger"; import { errorHandler } from "./middleware"; +import { auth } from "./routes"; const app = new Hono(); @@ -16,6 +17,8 @@ app.get("/api/health", (c) => { return c.json({ status: "ok" }); }); +app.route("/api/auth", auth); + const port = Number(process.env.PORT) || 3000; console.log(`Server is running on port ${port}`); |
