Add landing page, tests, Docker deployment, nginx config
This commit is contained in:
parent
feee0317ae
commit
8e03b8ab3c
5 changed files with 394 additions and 2 deletions
10
src/index.ts
10
src/index.ts
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue