mirror of
https://github.com/complexcaresolutions/frontend.blogwoman.de.git
synced 2026-03-17 16:14:00 +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
c6a0a4eada
commit
7fca02c725
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 blogwoman.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: blogwoman.de`)
|
||||
})
|
||||
})
|
||||
Loading…
Reference in a new issue