diff --git a/.env.example b/.env.example index 503be5c2..164a1246 100644 --- a/.env.example +++ b/.env.example @@ -1,10 +1,7 @@ -PORT=3001 +PORT=3000 DEBUG_MODE=true NODE_ENV=production -VITE_BACKEND_API_URL=http://localhost:3001 -VITE_COLLABORATION_URL= - JWT_SECRET_KEY=ba8642edbed7f6c450e46875e8c835c7e417031abe1f7b03f3e56bb7481706d8 JWT_TOKEN_EXPIRES_IN=30d diff --git a/apps/client/src/features/editor/hooks/use-collaboration-url.ts b/apps/client/src/features/editor/hooks/use-collaboration-url.ts index 5741becd..978b9add 100644 --- a/apps/client/src/features/editor/hooks/use-collaboration-url.ts +++ b/apps/client/src/features/editor/hooks/use-collaboration-url.ts @@ -1,6 +1,8 @@ const useCollaborationURL = (): string => { const PATH = "/collaboration"; + // TODO: revisit + /* if (import.meta.env.VITE_COLLABORATION_URL) { return import.meta.env.VITE_COLLABORATION_URL + PATH; } @@ -9,9 +11,12 @@ const useCollaborationURL = (): string => { if (!API_URL) { throw new Error("Backend API URL is not defined"); } + */ - const wsProtocol = API_URL.startsWith('https') ? 'wss' : 'ws'; - return `${wsProtocol}://${API_URL.split('://')[1]}${PATH}`; + const API_URL = window.location.protocol + "//" + window.location.host; + + const wsProtocol = API_URL.startsWith("https") ? "wss" : "ws"; + return `${wsProtocol}://${API_URL.split("://")[1]}${PATH}`; }; export default useCollaborationURL; diff --git a/apps/server/src/kysely/pagination/pagination.ts b/apps/server/src/kysely/pagination/pagination.ts index 9a299517..0896a416 100644 --- a/apps/server/src/kysely/pagination/pagination.ts +++ b/apps/server/src/kysely/pagination/pagination.ts @@ -23,7 +23,6 @@ export async function executeWithPagination( if (opts.page < 1) { opts.page = 1; } - console.log('perpage', opts.perPage); qb = qb.limit(opts.perPage + 1).offset((opts.page - 1) * opts.perPage); const deferredJoinPrimaryKey = opts.experimental_deferredJoinPrimaryKey;