16 lines
422 B
JavaScript
16 lines
422 B
JavaScript
import { createServer } from "node:http";
|
|
import next from "next";
|
|
|
|
const hostname = process.env.HOSTNAME || "127.0.0.1";
|
|
const port = Number(process.env.PORT || 3000);
|
|
const app = next({ dev: true, hostname, port });
|
|
const handle = app.getRequestHandler();
|
|
|
|
await app.prepare();
|
|
|
|
createServer((req, res) => {
|
|
handle(req, res);
|
|
}).listen(port, hostname, () => {
|
|
console.log(`Ready on http://${hostname}:${port}`);
|
|
});
|