chore(server): set up route for printing

This commit is contained in:
Elian Doran 2025-10-18 20:07:08 +03:00
parent 0d94ae9f61
commit fac31ff8be
No known key found for this signature in database
2 changed files with 11 additions and 2 deletions

View File

@ -0,0 +1,7 @@
import { Request } from "express";
export function getPrintablePage(req: Request) {
const { noteId } = req.params;
return "Hello world: " + noteId;
}

View File

@ -72,6 +72,7 @@ import etapiBackupRoute from "../etapi/backup.js";
import etapiMetricsRoute from "../etapi/metrics.js";
import apiDocsRoute from "./api_docs.js";
import { apiResultHandler, apiRoute, asyncApiRoute, asyncRoute, route, router, uploadMiddlewareWithErrorHandling } from "./route_api.js";
import { getPrintablePage } from "./api/print.js";
const GET = "get",
PST = "post",
@ -378,8 +379,6 @@ function register(app: express.Application) {
asyncApiRoute(PST, "/api/llm/chat/:chatNoteId/messages", llmRoute.sendMessage);
asyncApiRoute(PST, "/api/llm/chat/:chatNoteId/messages/stream", llmRoute.streamMessage);
// LLM provider endpoints - moved under /api/llm/providers hierarchy
asyncApiRoute(GET, "/api/llm/providers/ollama/models", ollamaRoute.listModels);
asyncApiRoute(GET, "/api/llm/providers/openai/models", openaiRoute.listModels);
@ -388,6 +387,9 @@ function register(app: express.Application) {
// API Documentation
apiDocsRoute(app);
// Printing route
apiRoute(GET, "/print/:noteId", getPrintablePage);
app.use("", router);
}