i dont know if this will work

Rather than repearting process.env.PORT... you could just write app.get("port")