2026-06-22 21:20:05 +06:00
|
|
|
/* eslint-disable @typescript-eslint/no-require-imports */
|
|
|
|
|
const { createServer } = require("http");
|
|
|
|
|
const next = require("next");
|
|
|
|
|
const { parse } = require("url");
|
2026-05-16 10:20:12 +06:00
|
|
|
|
2026-06-22 21:20:05 +06:00
|
|
|
const port = process.env.PORT || 3000;
|
|
|
|
|
const dev = process.env.NODE_ENV !== "production";
|
|
|
|
|
const app = next({ dev });
|
|
|
|
|
const handle = app.getRequestHandler();
|
2026-05-16 10:20:12 +06:00
|
|
|
|
|
|
|
|
app.prepare().then(() => {
|
|
|
|
|
createServer((req, res) => {
|
2026-06-22 21:20:05 +06:00
|
|
|
const parsedUrl = parse(req.url, true);
|
|
|
|
|
handle(req, res, parsedUrl);
|
2026-05-16 10:20:12 +06:00
|
|
|
}).listen(port, (err) => {
|
2026-06-22 21:20:05 +06:00
|
|
|
if (err) throw err;
|
|
|
|
|
console.log(`> Ready on http://localhost:${port}`);
|
|
|
|
|
});
|
|
|
|
|
});
|