From 4f21ccf70845d6001fdde70ab1912681f8213e1f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 8 Jul 2026 23:33:06 +0000 Subject: [PATCH 1/2] Initial plan From 0dd6c0cf74f137c73abbe5ffe6f96f0cbf80f366 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 8 Jul 2026 23:35:57 +0000 Subject: [PATCH 2/2] Enable Fly.io-compatible app startup and port configuration --- Dockerfile | 2 +- app/app.js | 2 +- fly.toml | 12 ++++++++++++ 3 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 fly.toml diff --git a/Dockerfile b/Dockerfile index 8a0f668..79bde8d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,4 +17,4 @@ COPY . /src # Expose our application port (3000) EXPOSE 3000 - +CMD ["node", "index.js"] diff --git a/app/app.js b/app/app.js index 8805579..fcde730 100644 --- a/app/app.js +++ b/app/app.js @@ -127,7 +127,7 @@ app.post("/api/reviews", (req, res) => { testDBConnection(); // Server -const PORT = 3000; +const PORT = process.env.PORT || 3000; app.listen(PORT, "0.0.0.0", () => { console.log(`Server running on port ${PORT}`); }); \ No newline at end of file diff --git a/fly.toml b/fly.toml new file mode 100644 index 0000000..ce12627 --- /dev/null +++ b/fly.toml @@ -0,0 +1,12 @@ +app = "softwareengineeringmodulecoursework" +primary_region = "lhr" + +[env] + PORT = "3000" + +[http_service] + internal_port = 3000 + force_https = true + auto_start_machines = true + min_machines_running = 0 + processes = ["app"]