Add landing page, tests, Docker deployment, nginx config

This commit is contained in:
DocFast Bot 2026-02-14 13:01:07 +00:00
parent feee0317ae
commit 8e03b8ab3c
5 changed files with 394 additions and 2 deletions

View file

@ -1,5 +1,7 @@
import express from "express";
import helmet from "helmet";
import path from "path";
import { fileURLToPath } from "url";
import rateLimit from "express-rate-limit";
import { convertRouter } from "./routes/convert.js";
import { templatesRouter } from "./routes/templates.js";
@ -30,8 +32,12 @@ app.use("/health", healthRouter);
app.use("/v1/convert", authMiddleware, convertRouter);
app.use("/v1/templates", authMiddleware, templatesRouter);
// Root
app.get("/", (_req, res) => {
// Landing page
const __dirname = path.dirname(fileURLToPath(import.meta.url));
app.use(express.static(path.join(__dirname, "../public")));
// API root (for programmatic discovery)
app.get("/api", (_req, res) => {
res.json({
name: "DocFast API",
version: "0.1.0",