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

Function openRunningLocalWebApp

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

Source from the content-addressed store, hash-verified

3286};
3287
3288const openRunningLocalWebApp = (): Effect.Effect<
3289 void,
3290 never,
3291 FileSystem.FileSystem | PlatformPath.Path
3292> =>
3293 Effect.gen(function* () {
3294 const manifest = yield* readActiveLocalServerManifest().pipe(Effect.orElseSucceed(() => null));
3295 if (!manifest) {
3296 printNoRunningLocalWebApp();
3297 return;
3298 }
3299 const { origin, auth } = manifest.connection;
3300 const token = auth?.kind === "bearer" ? auth.token : undefined;
3301 const url = token ? `${origin}/?_token=${token}` : origin;
3302 console.log(`Opening ${url}`);
3303 yield* openInBrowser(url);
3304 });
3305
3306/**
3307 * `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