Files
video-downloader/server.js
T
anthony ecdfc95ff3 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.
2026-08-11 15:24:30 +02:00

15 lines
354 B
JavaScript

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}`)
})
})