-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathserver.js
More file actions
19 lines (19 loc) · 815 Bytes
/
server.js
File metadata and controls
19 lines (19 loc) · 815 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const http_1 = require("http");
const url_1 = require("url");
const next_1 = __importDefault(require("next"));
const path_1 = __importDefault(require("path"));
const port = process.env.PORT || 5173;
const app = (0, next_1.default)({ dev: false, dir: path_1.default.join(__dirname) });
const handle = app.getRequestHandler();
app.prepare().then(() => {
(0, http_1.createServer)((req, res) => {
const parsedUrl = (0, url_1.parse)(req.url, true);
handle(req, res, parsedUrl);
}).listen(port);
console.log(`> Server listening at http://localhost:${port} as production`);
});