remove wrong props

This commit is contained in:
2025-10-08 23:31:09 +01:00
parent 9765d2be32
commit ca64eecffb
3 changed files with 29 additions and 5 deletions
+26
View File
@@ -0,0 +1,26 @@
const { createServer } = require('http');
const { parse } = require('url');
const next = require('next');
const dev = process.env.NODE_ENV !== 'production';
const hostname = process.env.HOSTNAME || 'localhost';
const port = parseInt(process.env.PORT || '3000', 10);
const app = next({ dev, hostname, port });
const handle = app.getRequestHandler();
app.prepare().then(() => {
createServer((req, res) => {
// Trust proxy headers from Cloudflare tunnel
const proto = req.headers['x-forwarded-proto'];
if (proto === 'https') {
req.connection.encrypted = true;
}
const parsedUrl = parse(req.url, true);
handle(req, res, parsedUrl);
}).listen(port, hostname, (err) => {
if (err) throw err;
console.log(`> Ready on http://${hostname}:${port}`);
});
});