79 lines
3.3 KiB
HTML
79 lines
3.3 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="de">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>nuscore Proxy Test</title>
|
|
<style>
|
|
body { font-family: Arial, sans-serif; margin: 20px; }
|
|
.test-section { margin: 20px 0; padding: 20px; border: 1px solid #ccc; border-radius: 8px; }
|
|
button { padding: 10px 20px; margin: 5px; background: #007bff; color: white; border: none; border-radius: 4px; cursor: pointer; }
|
|
button:hover { background: #0056b3; }
|
|
iframe { width: 100%; height: 600px; border: 1px solid #ccc; }
|
|
.status { padding: 10px; margin: 10px 0; border-radius: 4px; }
|
|
.success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
|
|
.error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<h1>nuscore Proxy Test</h1>
|
|
|
|
<div class="test-section">
|
|
<h2>Health Check</h2>
|
|
<button onclick="testHealth()">Health Check</button>
|
|
<div id="health-status" class="status"></div>
|
|
</div>
|
|
|
|
<div class="test-section">
|
|
<h2>Proxy Test</h2>
|
|
<input type="text" id="test-code" placeholder="Code eingeben" value="TEST123">
|
|
<button onclick="testProxy()">Proxy Test</button>
|
|
<div id="proxy-status" class="status"></div>
|
|
</div>
|
|
|
|
<div class="test-section">
|
|
<h2>Iframe Test</h2>
|
|
<button onclick="loadIframe()">Iframe laden</button>
|
|
<iframe id="test-iframe" style="display: none;"></iframe>
|
|
</div>
|
|
|
|
<script>
|
|
async function testHealth() {
|
|
const statusDiv = document.getElementById('health-status');
|
|
try {
|
|
const response = await fetch('http://localhost:3000/api/proxy/nuscore/health');
|
|
const data = await response.json();
|
|
statusDiv.innerHTML = `<div class="success">✅ Health Check OK: ${JSON.stringify(data)}</div>`;
|
|
} catch (error) {
|
|
statusDiv.innerHTML = `<div class="error">❌ Health Check Fehler: ${error.message}</div>`;
|
|
}
|
|
}
|
|
|
|
async function testProxy() {
|
|
const code = document.getElementById('test-code').value;
|
|
const statusDiv = document.getElementById('proxy-status');
|
|
|
|
try {
|
|
const response = await fetch(`http://localhost:3000/api/proxy/nuscore?code=${encodeURIComponent(code)}`);
|
|
const text = await response.text();
|
|
|
|
if (response.ok) {
|
|
statusDiv.innerHTML = `<div class="success">✅ Proxy OK: ${text.length} Zeichen empfangen</div>`;
|
|
} else {
|
|
statusDiv.innerHTML = `<div class="error">❌ Proxy Fehler: ${text}</div>`;
|
|
}
|
|
} catch (error) {
|
|
statusDiv.innerHTML = `<div class="error">❌ Proxy Fehler: ${error.message}</div>`;
|
|
}
|
|
}
|
|
|
|
function loadIframe() {
|
|
const code = document.getElementById('test-code').value;
|
|
const iframe = document.getElementById('test-iframe');
|
|
iframe.src = `http://localhost:3000/api/proxy/nuscore?code=${encodeURIComponent(code)}`;
|
|
iframe.style.display = 'block';
|
|
}
|
|
</script>
|
|
</body>
|
|
</html>
|