Restructure omni services and add Chatwoot research snapshot

This commit is contained in:
Ruslan Bakiev
2026-02-21 11:11:27 +07:00
parent edea7a0034
commit b73babbbf6
7732 changed files with 978203 additions and 32 deletions

36
omni_chat/src/index.ts Normal file
View File

@@ -0,0 +1,36 @@
import { createServer } from "node:http";
const port = Number(process.env.PORT || 8090);
const service = "omni_chat";
const server = createServer((req, res) => {
if (req.method === "GET" && req.url === "/health") {
const payload = JSON.stringify({
ok: true,
service,
receiverFlow: process.env.RECEIVER_FLOW_QUEUE_NAME || "receiver.flow",
senderFlow: process.env.SENDER_FLOW_QUEUE_NAME || "sender.flow",
now: new Date().toISOString(),
});
res.statusCode = 200;
res.setHeader("content-type", "application/json; charset=utf-8");
res.end(payload);
return;
}
res.statusCode = 404;
res.setHeader("content-type", "application/json; charset=utf-8");
res.end(JSON.stringify({ ok: false, error: "not_found" }));
});
server.listen(port, "0.0.0.0", () => {
console.log(`[omni_chat] listening on :${port}`);
});
function shutdown(signal: string) {
console.log(`[omni_chat] shutting down by ${signal}`);
server.close(() => process.exit(0));
}
process.on("SIGINT", () => shutdown("SIGINT"));
process.on("SIGTERM", () => shutdown("SIGTERM"));