create-mn-app 0.3.16 → 0.3.17
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/package.json
CHANGED
|
@@ -48,12 +48,20 @@ const CONFIG = {
|
|
|
48
48
|
async function waitForProofServer(maxAttempts = 30, delayMs = 2000): Promise<boolean> {
|
|
49
49
|
for (let attempt = 1; attempt <= maxAttempts; attempt++) {
|
|
50
50
|
try {
|
|
51
|
-
|
|
51
|
+
// Try a simple GET - any response (even 404) means server is up
|
|
52
|
+
const response = await fetch(CONFIG.proofServer, {
|
|
52
53
|
method: 'GET',
|
|
53
54
|
signal: AbortSignal.timeout(3000),
|
|
54
55
|
});
|
|
55
|
-
|
|
56
|
-
|
|
56
|
+
// Any response means the server is running
|
|
57
|
+
return true;
|
|
58
|
+
} catch (err: any) {
|
|
59
|
+
// Check if it's a connection refused vs other error
|
|
60
|
+
const errMsg = err?.cause?.code || err?.code || '';
|
|
61
|
+
if (errMsg !== 'ECONNREFUSED' && errMsg !== 'UND_ERR_CONNECT_TIMEOUT') {
|
|
62
|
+
// Got some other error - server might be up but returning errors
|
|
63
|
+
return true;
|
|
64
|
+
}
|
|
57
65
|
// Server not ready yet
|
|
58
66
|
}
|
|
59
67
|
if (attempt < maxAttempts) {
|