chore: 初始化项目骨架

This commit is contained in:
SkyJourney
2026-07-25 16:51:16 +08:00
commit ec48bce0a6
26 changed files with 3806 additions and 0 deletions
+37
View File
@@ -0,0 +1,37 @@
import Fastify from "fastify";
import {
EXPORT_CONFIG_VERSION,
defaultExportConfig,
supportedPaperFormats
} from "@md-to-pdf/core";
const port = Number.parseInt(process.env.PORT ?? "3001", 10);
const host = process.env.HOST ?? "0.0.0.0";
const app = Fastify({
logger: true
});
app.get("/api/health", async () => ({
status: "ok",
service: "md-to-pdf",
configVersion: EXPORT_CONFIG_VERSION
}));
app.get("/api/capabilities", async () => ({
defaultExportConfig,
supportedPaperFormats,
implemented: ["project-skeleton", "export-config", "theme-manifest"],
planned: ["markdown-render", "html-preview", "pdf-export"]
}));
async function start() {
try {
await app.listen({ port, host });
} catch (error) {
app.log.error(error);
process.exitCode = 1;
}
}
void start();