@devries-cameron20 / t3code Mirror · read-only
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 07:15 UTC

main
ts 17 lines 554 Bytes
Raw
1 import * as Effect from "effect/Effect";
2 import * as HttpApiClient from "effect/http-api/HttpApiClient";
3 import * as FetchHttpClient from "effect/http/FetchHttpClient";
4 import { ShortyApi } from "./ShortyApi.ts";
5
6 declare const API_URL: string;
7
8 // #region show
9 const shorty = HttpApiClient.make(ShortyApi, { baseUrl: API_URL });
10
11 export const createLink = (url: string) =>
12 shorty.pipe(
13 Effect.flatMap((client) => client.links.create({ payload: { url } })),
14 Effect.provide(FetchHttpClient.layer),
15 Effect.runPromise,
16 );
17 // #endregion show