diff --git a/server.js b/server.js index 0518145..c9ddd8b 100644 --- a/server.js +++ b/server.js @@ -4,7 +4,7 @@ const next = require("next"); const dev = process.env.NODE_ENV !== "production"; const hostname = "localhost"; -const port = 3000; +const port = process.env.PORT ?? 3000; // when using middleware `hostname` and `port` must be provided below const app = next({ dev, hostname, port }); const handle = app.getRequestHandler();