#!/usr/bin/env node
import http from "http";
const PORT = process.env.PORT || 3e3;
const server = http.createServer((req, res) => {
  console.log(`${(/* @__PURE__ */ new Date()).toISOString()} ${req.method} ${req.url}`);
  if (req.url === "/health") {
    res.writeHead(200, { "Content-Type": "application/json" });
    res.end(
      JSON.stringify({
        status: "healthy",
        timestamp: (/* @__PURE__ */ new Date()).toISOString(),
        port: PORT,
        env: process.env.NODE_ENV || "development"
      })
    );
  } else if (req.url === "/") {
    res.writeHead(200, { "Content-Type": "application/json" });
    res.end(
      JSON.stringify({
        message: "StackMemory Minimal Server Running",
        version: "1.0.0"
      })
    );
  } else {
    res.writeHead(404, { "Content-Type": "application/json" });
    res.end(JSON.stringify({ error: "Not found" }));
  }
});
server.listen(PORT, "0.0.0.0", () => {
  console.log(`
=================================
Minimal Server Started
Port: ${PORT}
Time: ${(/* @__PURE__ */ new Date()).toISOString()}
=================================
  `);
});
process.on("SIGTERM", () => {
  console.log("SIGTERM received");
  server.close(() => process.exit(0));
});
process.on("SIGINT", () => {
  console.log("SIGINT received");
  server.close(() => process.exit(0));
});
//# sourceMappingURL=minimal.js.map
