MCPcopy Create free account
hub / github.com/ComfyWorkflows/ComfyUI-Launcher / getProjectURL

Function getProjectURL

web/src/components/ProjectCard.tsx:26–46  ·  view source on GitHub ↗
(port: number, settings: Settings)

Source from the content-addressed store, hash-verified

24}
25
26const getProjectURL = (port: number, settings: Settings) => {
27 // get the window location
28 const { location } = window
29
30 // Support proxying for Runpod
31 // check if the current origin matches this pattern: https://<pod id>-<port number>.proxy.runpod.net
32 const match = location.origin.match(
33 /^https:\/\/([a-zA-Z0-9]+)-([0-9]+)\.proxy\.runpod\.net$/
34 )
35 if (match) {
36 // if it does, replace the port number with the new port number
37 return `https://${match[1]}-${port}.proxy.runpod.net`
38 }
39
40 if (settings.PROXY_MODE) {
41 return `/comfy/${port}/`; // proxy mode
42 }
43
44 // otherwise, replace the port in the current origin with the new port number
45 return location.origin.replace(/:[0-9]+$/, `:${port}`)
46}
47
48function ProjectCard({ item, settings }: ProjectCardProps) {
49 const queryClient = useQueryClient()

Callers 1

ProjectCardFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected