mirror of
https://github.com/complexcaresolutions/frontend.porwoll.de.git
synced 2026-03-17 17:33:41 +00:00
feat: add Phusion Passenger server.js for Plesk deployment
Required by Plesk Node.js Manager to start the Next.js production server via Phusion Passenger. Uses CommonJS for Passenger compatibility. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
68145ceb7e
commit
ce3b73ddb8
1 changed files with 26 additions and 0 deletions
26
server.js
Normal file
26
server.js
Normal file
|
|
@ -0,0 +1,26 @@
|
||||||
|
#\!/usr/bin/env node
|
||||||
|
/**
|
||||||
|
* Plesk Node.js Manager Entry Point (Phusion Passenger)
|
||||||
|
* Starts Next.js production server for porwoll.de
|
||||||
|
*/
|
||||||
|
|
||||||
|
const { createServer } = require("http")
|
||||||
|
const { parse } = require("url")
|
||||||
|
const next = require("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, "0.0.0.0", (err) => {
|
||||||
|
if (err) throw err
|
||||||
|
console.log(`Next.js server ready on http://0.0.0.0:${port}`)
|
||||||
|
console.log(`Environment: ${process.env.NODE_ENV}`)
|
||||||
|
console.log(`Site: porwoll.de`)
|
||||||
|
})
|
||||||
|
})
|
||||||
Loading…
Reference in a new issue