MCPcopy Create free account
hub / github.com/Cododev-Technology/cpeak / CpeakResponse

Interface CpeakResponse

lib/types.ts:36–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34}
35
36export interface CpeakResponse<ResBody = any> extends ServerResponse {
37 sendFile: (path: string, mime?: string) => Promise<void>;
38 status: (code: number) => CpeakResponse<ResBody>;
39 attachment: (filename?: string) => CpeakResponse<ResBody>;
40 cookie: (name: string, value: string, options?: CookieOptions) => CpeakResponse<ResBody>;
41 redirect: (location: string) => void;
42 json: (data: ResBody) => Promise<void>;
43 compress: (
44 mime: string,
45 body: Buffer | string | Readable,
46 size?: number
47 ) => Promise<void>;
48 render: (
49 filePath: string,
50 data: Record<string, unknown>,
51 mime?: string
52 ) => Promise<void>;
53 [key: string]: any; // allow developers to add their onw extensions (e.g. res.test)
54}
55
56export type Next = (err?: any) => void;
57

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected