Skip to content

Commit 30291cc

Browse files
author
Lasim
committed
fix: update base URL and enhance fetch requests with session management
1 parent 084289e commit 30291cc

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,6 @@ fastly-events.log
5454
.cache
5555

5656
deploystack.db
57-
services/backend/persistent_data/*
57+
services/backend/persistent_data/*
58+
59+
._*.ts

services/frontend/src/services/database.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ class DatabaseService {
66
private storageKey: string;
77

88
constructor() {
9-
this.baseUrl = getEnv('VITE_DEPLOYSTACK_BACKEND_URL') || 'http://localhost:3000';
9+
this.baseUrl = getEnv('VITE_DEPLOYSTACK_APP_URL') || 'http://localhost:3000';
1010
this.storageKey = `deploystack_db_setup_status_${this.baseUrl}`;
1111
}
1212

@@ -15,7 +15,13 @@ class DatabaseService {
1515
*/
1616
async checkStatus(): Promise<DbStatusResponse> {
1717
try {
18-
const response = await fetch(`${this.baseUrl}/api/db/status`);
18+
const response = await fetch(`${this.baseUrl}/api/db/status`, {
19+
method: 'GET',
20+
credentials: 'include', // Include cookies for session management
21+
headers: {
22+
'Content-Type': 'application/json',
23+
},
24+
});
1925

2026
if (!response.ok) {
2127
throw new Error(`HTTP error! status: ${response.status}`);
@@ -45,6 +51,7 @@ class DatabaseService {
4551
try {
4652
const response = await fetch(`${this.baseUrl}/api/db/setup`, {
4753
method: 'POST',
54+
credentials: 'include', // Include cookies for session management
4855
headers: {
4956
'Content-Type': 'application/json',
5057
},

0 commit comments

Comments
 (0)