Skip to main content
Glama
alexander-zuev

Kollektiv | Your private LLM knowledgebase

app.ts1.25 kB
import { allRoutesHandler, authCallbackHandler, getAuthorizeHandler, loginHandler, postAuthorizeHandler, rootHandler, testHandler, } from "@/web/handlers"; import type {OAuthHelpers} from "@cloudflare/workers-oauth-provider"; import {Hono} from "hono"; import {logoutHandler} from "@/web/handlers/logout"; import {AppRoutes} from "@/web/routes"; export type Bindings = Env & { OAUTH_PROVIDER: OAuthHelpers; }; const app = new Hono<{ Bindings: Bindings; }>(); // Apply middleware to all routes app.use(AppRoutes.ALL, allRoutesHandler); // Render a basic home page app.get(AppRoutes.ROOT, rootHandler); // Handle the OAuth authorization flow app.get(AppRoutes.AUTHORIZE, getAuthorizeHandler); // Validate the login information and complete the authorization request app.post(AppRoutes.AUTHORIZE, postAuthorizeHandler); // Exchange PKCE code for access and session tokens from Supabase app.get(AppRoutes.AUTH_CALLBACK, authCallbackHandler); // Handle login request (Oauth vs email) app.post(AppRoutes.LOGIN, loginHandler); // Handle logout request app.get(AppRoutes.LOGOUT, logoutHandler); // Handle test request app.get("/test-md", testHandler) // Export app as the default handler export default app;

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/alexander-zuev/kollektiv-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server