-
Notifications
You must be signed in to change notification settings - Fork 150
Expand file tree
/
Copy pathapi-proxy-simple-test.js
More file actions
69 lines (61 loc) · 2.06 KB
/
Copy pathapi-proxy-simple-test.js
File metadata and controls
69 lines (61 loc) · 2.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/**
* Simple Test Version of Enhanced API Proxy
* For debugging purposes
*/
console.log('🔍 Loading simple test API proxy...');
class SimpleEnhancedAPIProxy {
constructor() {
this.API_BASE = 'https://api.latanda.online/api';
this.isProxy = true;
this.version = "3.0.0-test";
console.log(`🚀 Simple API Proxy v${this.version} initialized`);
}
async makeRequest(endpoint, options = {}) {
console.log(`🔍 Simple API Proxy: ${options.method || 'GET'} ${endpoint}`);
// Basic test responses
const responses = {
'/system/health': {
success: true,
data: {
system: "healthy",
endpoints: 120,
version: "3.0.0-test"
}
},
'/auth/login': {
success: true,
data: {
message: "Login exitoso",
user: { id: "test_001", name: "Test User" },
auth_token: "test_token_123"
}
},
'/user/profile': {
success: true,
data: {
id: "test_001",
name: "Test User",
email: "test@latanda.online"
}
}
};
// Return mock response or default
return responses[endpoint] || {
success: true,
data: {
message: `Mock response for ${endpoint}`,
endpoint: endpoint,
method: options.method || 'GET'
}
};
}
}
// Initialize
console.log('🔍 Creating SimpleEnhancedAPIProxy instance...');
const simpleAPIProxy = new SimpleEnhancedAPIProxy();
// Make available globally
window.apiProxy = simpleAPIProxy;
window.enhancedAPIProxy = simpleAPIProxy;
window.comprehensiveAPIProxy = simpleAPIProxy;
console.log('✅ Simple API Proxy loaded successfully!');
console.log('✅ Available as window.apiProxy, window.enhancedAPIProxy, window.comprehensiveAPIProxy');