@kelceyp/caw-server 0.0.4 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.js +570 -131
- package/dist/main.js.map +12 -10
- package/dist/public_html/index.html +4 -144
- package/dist/public_html/main.js +177 -0
- package/dist/public_html/styles.css +2 -0
- package/package.json +3 -2
|
@@ -3,151 +3,11 @@
|
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8">
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
-
<title>CAW
|
|
7
|
-
<
|
|
8
|
-
* {
|
|
9
|
-
margin: 0;
|
|
10
|
-
padding: 0;
|
|
11
|
-
box-sizing: border-box;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
body {
|
|
15
|
-
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
|
|
16
|
-
background-color: #f5f5f5;
|
|
17
|
-
color: #333;
|
|
18
|
-
line-height: 1.6;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.container {
|
|
22
|
-
max-width: 600px;
|
|
23
|
-
margin: 80px auto;
|
|
24
|
-
padding: 40px;
|
|
25
|
-
background-color: white;
|
|
26
|
-
border-radius: 8px;
|
|
27
|
-
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
h1 {
|
|
31
|
-
font-size: 28px;
|
|
32
|
-
margin-bottom: 12px;
|
|
33
|
-
color: #2c3e50;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.subtitle {
|
|
37
|
-
font-size: 14px;
|
|
38
|
-
color: #7f8c8d;
|
|
39
|
-
margin-bottom: 32px;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
button {
|
|
43
|
-
background-color: #3498db;
|
|
44
|
-
color: white;
|
|
45
|
-
border: none;
|
|
46
|
-
padding: 12px 24px;
|
|
47
|
-
font-size: 16px;
|
|
48
|
-
border-radius: 4px;
|
|
49
|
-
cursor: pointer;
|
|
50
|
-
transition: background-color 0.2s;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
button:hover {
|
|
54
|
-
background-color: #2980b9;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
button:disabled {
|
|
58
|
-
background-color: #95a5a6;
|
|
59
|
-
cursor: not-allowed;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.response {
|
|
63
|
-
margin-top: 24px;
|
|
64
|
-
padding: 16px;
|
|
65
|
-
border-radius: 4px;
|
|
66
|
-
font-size: 14px;
|
|
67
|
-
display: none;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
.response.success {
|
|
71
|
-
background-color: #d4edda;
|
|
72
|
-
border: 1px solid #c3e6cb;
|
|
73
|
-
color: #155724;
|
|
74
|
-
display: block;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
.response.error {
|
|
78
|
-
background-color: #f8d7da;
|
|
79
|
-
border: 1px solid #f5c6cb;
|
|
80
|
-
color: #721c24;
|
|
81
|
-
display: block;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
.response-label {
|
|
85
|
-
font-weight: 600;
|
|
86
|
-
margin-bottom: 8px;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
.response-content {
|
|
90
|
-
font-family: 'Courier New', monospace;
|
|
91
|
-
white-space: pre-wrap;
|
|
92
|
-
word-break: break-all;
|
|
93
|
-
}
|
|
94
|
-
</style>
|
|
6
|
+
<title>CAW - Context and Workflow</title>
|
|
7
|
+
<link rel="stylesheet" href="/styles.css">
|
|
95
8
|
</head>
|
|
96
9
|
<body>
|
|
97
|
-
<div
|
|
98
|
-
|
|
99
|
-
<p class="subtitle">Test Client - Milestone 1</p>
|
|
100
|
-
|
|
101
|
-
<button id="testButton">Test API</button>
|
|
102
|
-
|
|
103
|
-
<div id="response" class="response">
|
|
104
|
-
<div class="response-label">Response:</div>
|
|
105
|
-
<div id="responseContent" class="response-content"></div>
|
|
106
|
-
</div>
|
|
107
|
-
</div>
|
|
108
|
-
|
|
109
|
-
<script>
|
|
110
|
-
const API_URL = 'http://localhost:3000/api/hello';
|
|
111
|
-
const BEARER_TOKEN = 'test-token-123';
|
|
112
|
-
|
|
113
|
-
const testButton = document.getElementById('testButton');
|
|
114
|
-
const responseDiv = document.getElementById('response');
|
|
115
|
-
const responseContent = document.getElementById('responseContent');
|
|
116
|
-
|
|
117
|
-
testButton.addEventListener('click', async () => {
|
|
118
|
-
testButton.disabled = true;
|
|
119
|
-
testButton.textContent = 'Testing...';
|
|
120
|
-
|
|
121
|
-
responseDiv.classList.remove('success', 'error');
|
|
122
|
-
responseDiv.style.display = 'none';
|
|
123
|
-
|
|
124
|
-
try {
|
|
125
|
-
const response = await fetch(API_URL, {
|
|
126
|
-
method: 'GET',
|
|
127
|
-
headers: {
|
|
128
|
-
'Authorization': `Bearer ${BEARER_TOKEN}`
|
|
129
|
-
}
|
|
130
|
-
});
|
|
131
|
-
|
|
132
|
-
const data = await response.json();
|
|
133
|
-
|
|
134
|
-
if (response.ok) {
|
|
135
|
-
responseDiv.classList.add('success');
|
|
136
|
-
responseContent.textContent = JSON.stringify(data, null, 2);
|
|
137
|
-
} else {
|
|
138
|
-
responseDiv.classList.add('error');
|
|
139
|
-
responseContent.textContent = `Error ${response.status}: ${JSON.stringify(data, null, 2)}`;
|
|
140
|
-
}
|
|
141
|
-
responseDiv.style.display = 'block';
|
|
142
|
-
} catch (error) {
|
|
143
|
-
responseDiv.classList.add('error');
|
|
144
|
-
responseContent.textContent = `Network error: ${error.message}`;
|
|
145
|
-
responseDiv.style.display = 'block';
|
|
146
|
-
} finally {
|
|
147
|
-
testButton.disabled = false;
|
|
148
|
-
testButton.textContent = 'Test API';
|
|
149
|
-
}
|
|
150
|
-
});
|
|
151
|
-
</script>
|
|
10
|
+
<div id="root"></div>
|
|
11
|
+
<script type="module" src="/main.js"></script>
|
|
152
12
|
</body>
|
|
153
13
|
</html>
|