Skip to content

Commit

Permalink
fix fly deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
bastipnt committed Aug 28, 2024
1 parent 86d955f commit 9d395ca
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions fly.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
app = 'ai-fortune-teller-backend'
primary_region = 'ams'

[env]
PORT = "3000"

[build]

[http_service]
Expand Down
6 changes: 3 additions & 3 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { serve } from "bun";
import TTS from "./tts";
import ChatManager from "./chatManager";
import UserManager, { User } from "./userManager";
import e from "./dbschema/edgeql-js";

const tts = new TTS();
const userManager = new UserManager();
Expand All @@ -17,6 +16,8 @@ const CORS_HEADERS = {
},
};

const port = process.env.PORT || 3000;

const server = serve({
async fetch(req) {
const url = new URL(req.url);
Expand Down Expand Up @@ -140,8 +141,7 @@ const server = serve({

return new Response("404!", CORS_HEADERS);
},
hostname: "0.0.0.0",
port: "3000",
port,
});

console.log(`Listening on ${server.hostname}:${server.port}`);
Expand Down

0 comments on commit 9d395ca

Please sign in to comment.