fix: usar /api/health em vez de localhost:3002 (corrige CORS)

This commit is contained in:
Hermes
2026-05-17 22:30:44 +00:00
parent 5ff5f4feb9
commit 207fd1b0a0
+8 -8
View File
@@ -100,8 +100,8 @@ async function checkServiceStatus() {
const statusIndicator = document.getElementById('serviceStatus');
try {
// Verificar o serviço WGET na porta 3002 (não 3001)
const response = await fetch('http://localhost:3002/health', {
// Verificar o serviço WGET via proxy do servidor (mesma origem)
const response = await fetch('/api/health', {
method: 'GET'
});
@@ -582,18 +582,18 @@ function saveSettings() {
// Utility Functions
function openClonedSite(directory) {
// Try to open via server endpoint
fetch('http://localhost:8080', {
fetch('/api/health', {
method: 'GET'
}).then(response => {
if (response.ok) {
// Server is running, open the site
const siteName = directory.split('\\').pop();
window.open(`http://localhost:8080/${siteName}/`, '_blank');
// Server is running, open the site via same origin
const siteName = directory.split('/').pop();
window.open(`/${siteName}/index.html`, '_blank');
} else {
showToast('Servidor HTTP não está rodando. Inicie o servidor na porta 8080.', 'error');
showToast('Servidor não está respondendo.', 'error');
}
}).catch(error => {
showToast('Servidor HTTP não está rodando. Inicie o servidor na porta 8080.', 'error');
showToast('Servidor não está respondendo.', 'error');
});
}