mirror of
https://github.com/complexcaresolutions/frontend.zweitmeinu.ng.git
synced 2026-03-17 15:03:48 +00:00
chore: add server.js for Plesk Passenger startup
Required by Phusion Passenger on Plesk production. Must not be deleted by git clean or deploys will 500.
This commit is contained in:
parent
bedcd76fdd
commit
ba59457100
1 changed files with 17 additions and 0 deletions
17
server.js
Normal file
17
server.js
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
const { createServer } = require("http")
|
||||||
|
const { parse } = require("url")
|
||||||
|
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) => {
|
||||||
|
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)
|
||||||
|
})
|
||||||
|
})
|
||||||
Loading…
Reference in a new issue