@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, 04:45 UTC

main
ts 21 lines 838 Bytes
Raw
1 import * as HttpApi from "effect/http-api/HttpApi";
2 import * as HttpApiEndpoint from "effect/http-api/HttpApiEndpoint";
3 import * as HttpApiGroup from "effect/http-api/HttpApiGroup";
4 import * as Schema from "effect/Schema";
5 import { User } from "./current-user.ts";
6 import { Authentication } from "./middleware.ts";
7
8 export class Public extends HttpApiGroup.make("public").add(
9 HttpApiEndpoint.get("health", "/api/health", {
10 success: Schema.Struct({ ok: Schema.Literal(true) }),
11 }),
12 HttpApiEndpoint.get("providers", "/api/providers", {
13 success: Schema.Struct({ github: Schema.Boolean }),
14 }),
15 ) {}
16
17 export class Private extends HttpApiGroup.make("private")
18 .add(HttpApiEndpoint.get("me", "/api/me", { success: User }))
19 .middleware(Authentication) {}
20
21 export class Api extends HttpApi.make("app").add(Public, Private) {}