feat(api): scaffold express server with /api/health endpoint

This commit is contained in:
lila 2026-03-21 10:17:53 +01:00
parent 04acd4b580
commit a0f008be74
4 changed files with 34 additions and 1 deletions

12
apps/api/src/app.ts Normal file
View file

@ -0,0 +1,12 @@
import express from "express";
import type { Express } from "express";
export function createApp() {
const app: Express = express();
app.get("/api/health", (_req, res) => {
res.json({ status: "ok" });
});
return app;
}

9
apps/api/src/server.ts Normal file
View file

@ -0,0 +1,9 @@
import { createApp } from "./app.js";
const PORT = Number(process.env["PORT"] ?? 3000);
const app = createApp();
app.listen(PORT, () => {
console.log(`Server listening on port ${PORT}`);
});