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

Function openRunningLocalWebApp

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

Source from the content-addressed store, hash-verified

3239};
3240
3241const openRunningLocalWebApp = (): Effect.Effect<
3242 void,
3243 never,
3244 FileSystem.FileSystem | PlatformPath.Path
3245> =>
3246 Effect.gen(function* () {
3247 const manifest = yield* readActiveLocalServerManifest().pipe(Effect.orElseSucceed(() => null));
3248 if (!manifest) {
3249 printNoRunningLocalWebApp();
3250 return;
3251 }
3252 const { origin, auth } = manifest.connection;
3253 const token = auth?.kind === "bearer" ? auth.token : undefined;
3254 const url = token ? `${origin}/?_token=${token}` : origin;
3255 console.log(`Opening ${url}`);
3256 yield* openInBrowser(url);
3257 });
3258
3259/**
3260 * `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