import {
HttpApi,
HttpApiClient,
HttpApiEndpoint,
HttpApiGroup
} from "@effect/platform"
import { Effect, Schema } from "effect"
const api = HttpApi.make("api").add(
// Mark the group as top-level
HttpApiGroup.make("group", { topLevel: true }).add(
HttpApiEndpoint.get("get", "/").addSuccess(Schema.String)
)
)
const program = Effect.gen(function* () {
const client = yield* HttpApiClient.make(api, {
baseUrl: "http://localhost:3000"
})
// The `get` method is not nested under the "group" name
const user = yield* client.get()
console.log(user)
})
import {
HttpApi,
HttpApiClient,
HttpApiEndpoint,
HttpApiGroup
} from "@effect/platform"
import { Effect, Schema } from "effect"
const api = HttpApi.make("api").add(
// Mark the group as top-level
HttpApiGroup.make("group", { topLevel: true }).add(
HttpApiEndpoint.get("get", "/").addSuccess(Schema.String)
)
)
const program = Effect.gen(function* () {
const client = yield* HttpApiClient.make(api, {
baseUrl: "http://localhost:3000"
})
// The `get` method is not nested under the "group" name
const user = yield* client.get()
console.log(user)
})