Initial commit from Create Next App

This commit is contained in:
Gavin McDonald
2025-04-09 09:13:53 -04:00
commit a7708b4fad
12 changed files with 1686 additions and 0 deletions

21
server.ts Normal file
View File

@@ -0,0 +1,21 @@
import { createServer } from "http";
import { parse } from "url";
import next from "next";
const port = parseInt(process.env.PORT || "3000", 10);
const dev = process.env.NODE_ENV !== "production";
const app = next({ dev });
const handle = app.getRequestHandler();
app.prepare().then(() => {
createServer((req, res) => {
const parsedUrl = parse(req.url!, true);
handle(req, res, parsedUrl);
}).listen(port);
console.log(
`> Server listening at http://localhost:${port} as ${
dev ? "development" : process.env.NODE_ENV
}`,
);
});