Skip to content
Closed
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: 1 addition & 0 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"license": "ISC",
"type": "module",
"dependencies": {
"cors": "^2.8.5",
"dotenv": "^17.2.3",
"express": "^5.1.0",
"express-validator": "^7.2.1",
Expand Down
5 changes: 4 additions & 1 deletion server.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'dotenv/config';
import express from 'express';
import http from "http";
import cors from 'cors'; // Added CORS import
import { initializeDatabase, initializeStorage } from './src/services/connectionService.js';
import healthRoutes from './src/routes/health.js';
import { setupSocket } from './src/socket/socket.js';
Expand All @@ -14,6 +15,8 @@ import cashRequestRoutes from './src/routes/cashRequestRoutes.js';
const app = express();
const server = http.createServer(app);

// Enable CORS (this is the only new middleware)
app.use(cors());

//Socket.io
setupSocket(server);
Expand Down Expand Up @@ -76,4 +79,4 @@ async function startServer() {
}

// Start the server
startServer();
startServer();