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:
@@ -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}`)
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user