Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
**/.DS_Store
.notion
node_modules/.vite/deps

**/.auth
#.env
Expand Down

This file was deleted.

171 changes: 171 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
"@types/node": "^24.6.2",
"@types/react": "^19.2.0",
"@types/react-dom": "^19.2.0",
"@types/supertest": "^6.0.3",
"@vitejs/plugin-react-swc": "^4.1.0",
"@vitest/coverage-v8": "^3.2.4",
"@vitest/ui": "^3.2.4",
Expand All @@ -96,6 +97,7 @@
"jsdom": "^27.0.0",
"lovable-tagger": "^1.1.10",
"postcss": "^8.5.6",
"supertest": "^7.1.4",
"tailwindcss": "^3.4.17",
"tailwindcss-animate": "^1.0.7",
"ts-node": "^10.9.2",
Expand Down
16 changes: 11 additions & 5 deletions src/server/chatSyncApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import http from 'http';
import { getAllChats, addOrUpdateChats, deleteChat, deleteChats } from './chatStore.js';

const PORT = process.env.CHAT_SYNC_PORT || 4001;

// Utility: parse JSON body
function parseBody(req) {
return new Promise((resolve, reject) => {
Expand Down Expand Up @@ -102,8 +104,12 @@ const server = http.createServer(async (req, res) => {
}
});

// Start server
const PORT = process.env.CHAT_SYNC_PORT || 4001;
server.listen(PORT, () => {
console.log(`Chat sync API running on http://localhost:${PORT}`);
});
// Only start the server if this file is run directly
if (import.meta.url === `file://${process.argv[1]}`) {
server.listen(PORT, () => {
console.log(`Chat sync API running on http://localhost:${PORT}`);
});
}

// Export for testing
export { server };
File renamed without changes.
File renamed without changes.
Loading
Loading