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

Function openRunningLocalWebApp

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

Source from the content-addressed store, hash-verified

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