Skip to content
Open
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
8 changes: 4 additions & 4 deletions backend/package-lock.json

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

2 changes: 1 addition & 1 deletion backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"cookie-parser": "^1.4.6",
"cookies": "^0.8.0",
"cors": "^2.8.5",
"dotenv": "^16.3.1",
"dotenv": "^16.5.0",
"express": "^4.18.2",
"express-fileupload": "^1.5.1",
"firebase": "^10.5.2",
Expand Down
2 changes: 2 additions & 0 deletions backend/routes/note.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
const express = require("express");
const { createNote, getNotes } = require("../controllers/note.controller");
const { uploadFile } = require("../controllers/file.controller");
const {deleteNote } = require("../controllers/note.controller");


const router = express.Router();

Expand Down
6 changes: 4 additions & 2 deletions backend/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@ app.options('*', cors()); // Allow preflight requests

app.use(cors({
origin: 'http://localhost:5173',
credentials: true, // ✅ REQUIRED for withCredentials to work
methods: 'GET,POST,PUT,DELETE',
allowedHeaders: 'Content-Type,Authorization'
}));


app.use(express.urlencoded({ extended: true }));
app.use(fileUpload());
app.use((req, res, next) => {
Expand All @@ -30,8 +32,8 @@ app.use((req, res, next) => {
app.use('/api/notes', noteRoutes);

// Connect to database
const CONNECTION_URL = process.env.CONNECTION_URL;
const PORT = process.env.PORT || 5000;
const CONNECTION_URL = process.env.MONGO_URI;
const PORT = process.env.PORT || 5015;

if (!CONNECTION_URL) {
console.error('Database connection URL is not defined in environment variables.');
Expand Down
Loading