Initial Node.js TypeScript service

This commit is contained in:
AppFactory Bot
2026-07-15 06:49:26 +00:00
commit 4b98f37407
7 changed files with 440 additions and 0 deletions
+35
View File
@@ -0,0 +1,35 @@
import express from "express";
const app = express();
const port = Number(process.env.PORT || 3000);
const rootPath = process.env.ROOT_PATH || "";
app.get("/", (_req, res) => {
res.json({
name: "Polstrin SAP BO1",
service: "polstrin-sap",
status: "ok"
});
});
app.get("/health", (_req, res) => {
res.json({ status: "ok" });
});
if (rootPath) {
app.get(rootPath, (_req, res) => {
res.json({
name: "Polstrin SAP BO1",
service: "polstrin-sap",
status: "ok"
});
});
app.get(rootPath + "/health", (_req, res) => {
res.json({ status: "ok" });
});
}
app.listen(port, "0.0.0.0", () => {
console.log("polstrin-sap listening on port " + port);
});