Initial Node.js TypeScript service

This commit is contained in:
AppFactory Bot
2026-06-15 11:34:26 +00:00
commit 3b0a61fd5a
7 changed files with 435 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: "google-service",
service: "google-service",
status: "ok"
});
});
app.get("/health", (_req, res) => {
res.json({ status: "ok" });
});
if (rootPath) {
app.get(rootPath, (_req, res) => {
res.json({
name: "google-service",
service: "google-service",
status: "ok"
});
});
app.get(rootPath + "/health", (_req, res) => {
res.json({ status: "ok" });
});
}
app.listen(port, "0.0.0.0", () => {
console.log("google-service listening on port " + port);
});