feat: add Passenger-compatible server.js startup file for o2switch

Passenger runs a literal JS entry file, not the next start CLI or an
npm script, so a custom server was needed for cPanel's Node.js App
startup file field.
This commit is contained in:
2026-08-11 15:24:30 +02:00
parent 09600118a5
commit ecdfc95ff3
3 changed files with 19 additions and 3 deletions
+14
View File
@@ -0,0 +1,14 @@
const { createServer } = require('http')
const next = require('next')
const port = parseInt(process.env.PORT || '3000', 10)
const app = next({ dev: false })
const handle = app.getRequestHandler()
app.prepare().then(() => {
createServer((req, res) => {
handle(req, res)
}).listen(port, () => {
console.log(`> Ready on port ${port}`)
})
})