Licence
MIT
Version
1.0.1
Deps
1
Size
7 kB
Vulns
0
Weekly
0
@askdock/server
The Askdock route handler. A plain Request → Response function, so it runs anywhere with fetch.
// app/api/askdock/route.ts
import { createAskdockHandler } from "@askdock/server";
import corpus from "../../../.askdock/corpus.json";
export const POST = createAskdockHandler({
model: { model: "google/gemini-3.1-flash-lite" },
corpus,
persona: { name: "Acme AI", fallbackHref: "/contact" },
});
Next.js, Hono, Bun, Deno — same line. Ships a per-IP rate limit, closed CORS, and an authorize hook.
This file is where your API key lives. It is read from the server environment and never reaches the browser.
Part of Askdock — a chat widget that only knows your site. Full documentation, configuration reference and recipes are in the main README.
MIT.