// Startup file for Passenger-based hosts (cPanel "Setup Node.js App", Plesk).
// Set this file as the "Application startup file". Requires a prior `npm run build`.
const { createServer } = require("http");
const next = require("next");

const port = parseInt(process.env.PORT || "3000", 10);
const hostname = process.env.HOSTNAME || "0.0.0.0";

const app = next({ dev: false, hostname, port });
const handle = app.getRequestHandler();

app.prepare().then(() => {
  createServer((req, res) => handle(req, res)).listen(port, () => {
    console.log(`> akarya.id ready on http://${hostname}:${port}`);
  });
});
