diff options
| author | nsfisis <nsfisis@gmail.com> | 2025-12-31 01:10:56 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2025-12-31 01:10:56 +0900 |
| commit | 352f7891588e9c33d27c2a189a414c5b4822e9fa (patch) | |
| tree | 19b086ba815816ba0b6825c48c0bccdec4958a03 /src/server/index.ts | |
| parent | 9165e1d82c49f247d0d2aa763395a199d9b3f8e4 (diff) | |
| download | kioku-352f7891588e9c33d27c2a189a414c5b4822e9fa.tar.gz kioku-352f7891588e9c33d27c2a189a414c5b4822e9fa.tar.zst kioku-352f7891588e9c33d27c2a189a414c5b4822e9fa.zip | |
feat(api): add Note API routes for CRUD operations
Add REST endpoints for notes under /api/decks/:deckId/notes:
- GET / - List notes in deck
- POST / - Create note with auto-generated cards
- GET /:noteId - Get note with field values
- PUT /:noteId - Update note field values
- DELETE /:noteId - Delete note and its cards (cascade)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Diffstat (limited to 'src/server/index.ts')
| -rw-r--r-- | src/server/index.ts | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/server/index.ts b/src/server/index.ts index 91f76fb..52eab67 100644 --- a/src/server/index.ts +++ b/src/server/index.ts @@ -2,7 +2,15 @@ import { serve } from "@hono/node-server"; import { Hono } from "hono"; import { logger } from "hono/logger"; import { createCorsMiddleware, errorHandler } from "./middleware/index.js"; -import { auth, cards, decks, noteTypes, study, sync } from "./routes/index.js"; +import { + auth, + cards, + decks, + notes, + noteTypes, + study, + sync, +} from "./routes/index.js"; const app = new Hono(); @@ -21,6 +29,7 @@ const routes = app .route("/api/auth", auth) .route("/api/decks", decks) .route("/api/decks/:deckId/cards", cards) + .route("/api/decks/:deckId/notes", notes) .route("/api/decks/:deckId/study", study) .route("/api/note-types", noteTypes) .route("/api/sync", sync); |
