mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-19 22:09:37 +00:00
13 lines
351 B
TypeScript
13 lines
351 B
TypeScript
import axios from 'axios'
|
|
|
|
const VALID_STATUS_CODES = [200, 201, 301, 302, 307, 308]
|
|
export const checkUrlReachable = async (url: string): Promise<boolean> => {
|
|
try {
|
|
const response = await axios.head(url)
|
|
// Additional check for successful response
|
|
return VALID_STATUS_CODES.includes(response.status)
|
|
} catch {
|
|
return false
|
|
}
|
|
}
|