MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / openRunningLocalWebApp

Function openRunningLocalWebApp

apps/cli/src/main.ts:3259–3275  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3257};
3258
3259const openRunningLocalWebApp = (): Effect.Effect<
3260 void,
3261 never,
3262 FileSystem.FileSystem | PlatformPath.Path
3263> =>
3264 Effect.gen(function* () {
3265 const manifest = yield* readActiveLocalServerManifest().pipe(Effect.orElseSucceed(() => null));
3266 if (!manifest) {
3267 printNoRunningLocalWebApp();
3268 return;
3269 }
3270 const { origin, auth } = manifest.connection;
3271 const token = auth?.kind === "bearer" ? auth.token : undefined;
3272 const url = token ? `${origin}/?_token=${token}` : origin;
3273 console.log(`Opening ${url}`);
3274 yield* openInBrowser(url);
3275 });
3276
3277/**
3278 * `executor open` — the friendly way back in. Reads the running local server's

Callers 1

main.tsFile · 0.85

Calls 3

openInBrowserFunction · 0.85
logMethod · 0.80

Tested by

no test coverage detected