Initial commit

This commit is contained in:
agent
2026-03-13 23:21:55 +00:00
commit c8ed262197
113 changed files with 13211 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
import express, { type Express } from "express";
import cors from "cors";
import router from "./routes";
const app: Express = express();
app.use(cors());
app.use(express.json());
app.use(express.urlencoded({ extended: true }));
app.use("/api", router);
export default app;

View File

@@ -0,0 +1,19 @@
import app from "./app";
const rawPort = process.env["PORT"];
if (!rawPort) {
throw new Error(
"PORT environment variable is required but was not provided.",
);
}
const port = Number(rawPort);
if (Number.isNaN(port) || port <= 0) {
throw new Error(`Invalid PORT value: "${rawPort}"`);
}
app.listen(port, () => {
console.log(`Server listening on port ${port}`);
});

View File

View File

@@ -0,0 +1,11 @@
import { Router, type IRouter } from "express";
import { HealthCheckResponse } from "@workspace/api-zod";
const router: IRouter = Router();
router.get("/healthz", (_req, res) => {
const data = HealthCheckResponse.parse({ status: "ok" });
res.json(data);
});
export default router;

View File

@@ -0,0 +1,8 @@
import { Router, type IRouter } from "express";
import healthRouter from "./health";
const router: IRouter = Router();
router.use(healthRouter);
export default router;