Move onClick handlers to separate functions and add PORT env variable for backend

This commit is contained in:
2024-08-30 16:06:46 +02:00
parent c959741f45
commit 36a67a2ca1
3 changed files with 82 additions and 69 deletions

View File

@@ -14,5 +14,4 @@ export const OPENAI_API_KEY= process.env["OPENAI_API_KEY"] || "";
export const OPENAI_MODEL = process.env["OPENAI_MODEL"] || "gpt-4o";
export const OLLAMA_URL= process.env["OLLAMA_URL"] || "http://localhost:11434";
export const OLLAMA_MODEL= process.env["OLLAMA_MODEL"] || "moondream";
// list all files in /usr/src/app/data/
export const PORT = parseInt(process.env["PORT"]!) || 3000;

View File

@@ -24,6 +24,6 @@ wss.on('connection', (ws: WebSocket) => {
});
});
server.listen(3000, () => {
logger.info(`Server is running on http://localhost:${3000}`);
server.listen(PORT, () => {
logger.info(`Server is running on http://localhost:${PORT}`);
});