MCPcopy
hub / github.com/tinyhttp/tinyhttp / Response

Interface Response

packages/app/src/response.ts:24–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22}
23
24export interface Response<O = any> extends ServerResponse {
25 header(field: string | Record<string, unknown>, val?: string | any[]): Response
26 set(field: string | Record<string, unknown>, val?: string | any[]): Response
27 get(field: string): string | number | string[]
28 send(body: unknown): Response
29 sendFile(path: string, options?: ReadStreamOptions, cb?: (err?: any) => void): Response
30 json(body: unknown): Response
31 status(status: number): Response
32 sendStatus(statusCode: number): Response
33 cookie(
34 name: string,
35 value: string | Record<string, unknown>,
36 options?: SerializeOptions & Partial<{ signed: boolean }>
37 ): Response
38 clearCookie(name: string, options?: SerializeOptions): Response
39 location(url: string): Response
40 links(links: { [key: string]: string }): Response
41 render(file: string, data?: Record<string, any>, options?: TemplateEngineOptions<O>): Response
42 vary(field: string): Response
43 format(obj: FormatProps): Response
44 redirect(url: string, status?: number): Response
45 type(type: string): Response
46 download(path: string, filename: string, options?: DownloadOptions, cb?: (err?: any) => void): Response
47 attachment(filename?: string): Response
48 app?: App
49 locals?: Record<string, any>
50 /**
51 * Send JSON response with JSONP callback support.
52 *
53 * To enable this method, install the `@tinyhttp/jsonp` package and attach the method to `res.jsonp` property.
54 *
55 * @param obj Response object
56 */
57 jsonp(obj: any): Response
58
59 append(field: string, value: any): Response
60}

Callers 63

jsonpFunction · 0.65
installPackagesFunction · 0.65
saveMethod · 0.65
index.jsFile · 0.65
index.jsFile · 0.65
index.jsFile · 0.65
request.test.tsFile · 0.65
app.test.tsFile · 0.65
jsonpFunction · 0.65
index.tsFile · 0.65
installPackagesFunction · 0.65
reloadMethod · 0.65

Calls

no outgoing calls

Tested by

no test coverage detected