diff --git a/backend/server.js b/backend/server.js index dbea635..f257276 100644 --- a/backend/server.js +++ b/backend/server.js @@ -11,8 +11,8 @@ const app = express(); const corsUrl = process.env.FRONTEND_URL; -app.use(express.urlencoded({ extended: true })); // Parses form data -app.use(express.json()); // Parses JSON data +app.use(express.urlencoded({ extended: true, limit: '50mb' })); // Increase URL-encoded payload limit +app.use(express.json({ limit: '50mb' })); // Increase JSON payload limit // Configure CORS to allow specific origins const allowedOrigins = [ diff --git a/frontend/src/routes/home/+page.svelte b/frontend/src/routes/home/+page.svelte index 5b04a5e..6232ded 100644 --- a/frontend/src/routes/home/+page.svelte +++ b/frontend/src/routes/home/+page.svelte @@ -26,7 +26,7 @@ // Function to simulate search API call async function searchDocuments(query) { try { - const res = await fetch(`http://localhost:3010/api/document/search?query=${query}`); + const res = await fetch(`https://docucenter.mpe.ca/api/document/search?query=${query}`); const data = await res.json(); if (data.length > 0) { @@ -43,7 +43,7 @@ // Function to fetch all documents from the API async function getAllDocuments() { try { - const res = await fetch(`http://localhost:3010/api/document`); + const res = await fetch(`https://docucenter.mpe.ca/api/document`); if (!res.ok) { throw new Error(`Failed to fetch documents: ${res.statusText}`); @@ -77,7 +77,6 @@ DocuCenter -
{#if $page.data.user.role == "admin"}
@@ -129,10 +128,16 @@