Spaces:
Sleeping
Sleeping
Update static/test.js
Browse files- static/test.js +5 -3
static/test.js
CHANGED
|
@@ -14,9 +14,11 @@ document.addEventListener('DOMContentLoaded', function() {
|
|
| 14 |
});
|
| 15 |
|
| 16 |
// API configuration
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
|
|
|
|
|
|
| 20 |
// Summarize document
|
| 21 |
document.getElementById('summarize-btn').addEventListener('click', async function() {
|
| 22 |
const fileInput = document.getElementById('summarize-file');
|
|
|
|
| 14 |
});
|
| 15 |
|
| 16 |
// API configuration
|
| 17 |
+
const API_BASE_URL = window.location.origin;
|
| 18 |
+
const API_PREFIX = '/api';
|
| 19 |
+
...
|
| 20 |
+
fetch(`${API_BASE_URL}${API_PREFIX}/summarize`, ...)
|
| 21 |
+
|
| 22 |
// Summarize document
|
| 23 |
document.getElementById('summarize-btn').addEventListener('click', async function() {
|
| 24 |
const fileInput = document.getElementById('summarize-file');
|