koatty 3.5.12-1 → 3.5.12-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/index.mjs +2 -2
- package/dist/package.json +3 -3
- package/package.json +3 -3
- package/.commitlintrc.js +0 -3
- package/.eslintignore +0 -11
- package/.eslintrc.js +0 -43
- package/.huskyrc +0 -5
- package/.versionrc.js +0 -16
- package/api-extractor.json +0 -345
- package/docs/api/index.md +0 -12
- package/docs/api/koatty.apiinput.code.md +0 -11
- package/docs/api/koatty.apiinput.data.md +0 -11
- package/docs/api/koatty.apiinput.md +0 -22
- package/docs/api/koatty.apiinput.message.md +0 -11
- package/docs/api/koatty.apioutput.code.md +0 -11
- package/docs/api/koatty.apioutput.data.md +0 -11
- package/docs/api/koatty.apioutput.md +0 -22
- package/docs/api/koatty.apioutput.message.md +0 -11
- package/docs/api/koatty.appreadyhookfunc.md +0 -11
- package/docs/api/koatty.basecontroller._constructor_.md +0 -20
- package/docs/api/koatty.basecontroller._options.md +0 -11
- package/docs/api/koatty.basecontroller.app.md +0 -11
- package/docs/api/koatty.basecontroller.ctx.md +0 -11
- package/docs/api/koatty.basecontroller.fail.md +0 -28
- package/docs/api/koatty.basecontroller.init.md +0 -19
- package/docs/api/koatty.basecontroller.md +0 -39
- package/docs/api/koatty.basecontroller.ok.md +0 -28
- package/docs/api/koatty.baseservice._constructor_.md +0 -20
- package/docs/api/koatty.baseservice._options.md +0 -11
- package/docs/api/koatty.baseservice.app.md +0 -11
- package/docs/api/koatty.baseservice.init.md +0 -25
- package/docs/api/koatty.baseservice.md +0 -36
- package/docs/api/koatty.bindappreadyhook.md +0 -26
- package/docs/api/koatty.bootstrap.md +0 -27
- package/docs/api/koatty.component.md +0 -27
- package/docs/api/koatty.componentscan.md +0 -27
- package/docs/api/koatty.configurationscan.md +0 -27
- package/docs/api/koatty.controller.md +0 -27
- package/docs/api/koatty.httpcontroller.body.md +0 -28
- package/docs/api/koatty.httpcontroller.deny.md +0 -26
- package/docs/api/koatty.httpcontroller.expires.md +0 -26
- package/docs/api/koatty.httpcontroller.fail.md +0 -28
- package/docs/api/koatty.httpcontroller.header.md +0 -27
- package/docs/api/koatty.httpcontroller.isget.md +0 -19
- package/docs/api/koatty.httpcontroller.ismethod.md +0 -26
- package/docs/api/koatty.httpcontroller.ispost.md +0 -19
- package/docs/api/koatty.httpcontroller.json.md +0 -26
- package/docs/api/koatty.httpcontroller.md +0 -35
- package/docs/api/koatty.httpcontroller.ok.md +0 -28
- package/docs/api/koatty.httpcontroller.param.md +0 -26
- package/docs/api/koatty.httpcontroller.redirect.md +0 -27
- package/docs/api/koatty.httpcontroller.type.md +0 -27
- package/docs/api/koatty.icontroller.__after.md +0 -11
- package/docs/api/koatty.icontroller.__befor.md +0 -11
- package/docs/api/koatty.icontroller.app.md +0 -11
- package/docs/api/koatty.icontroller.ctx.md +0 -11
- package/docs/api/koatty.icontroller.fail.md +0 -11
- package/docs/api/koatty.icontroller.md +0 -25
- package/docs/api/koatty.icontroller.ok.md +0 -11
- package/docs/api/koatty.imiddleware.md +0 -20
- package/docs/api/koatty.imiddleware.run.md +0 -11
- package/docs/api/koatty.iplugin.md +0 -20
- package/docs/api/koatty.iplugin.run.md +0 -11
- package/docs/api/koatty.iservice.app.md +0 -11
- package/docs/api/koatty.iservice.md +0 -20
- package/docs/api/koatty.logger.md +0 -11
- package/docs/api/koatty.md +0 -51
- package/docs/api/koatty.middleware.md +0 -27
- package/docs/api/koatty.plugin.md +0 -27
- package/docs/api/koatty.service.md +0 -27
- package/jest.config.js +0 -34
- package/jest_html_reporters.html +0 -60
- package/rollup.config.js +0 -63
- package/scripts/copyright.js +0 -28
- package/scripts/postBuild.js +0 -10
- package/tsconfig.json +0 -69
@@ -1,20 +0,0 @@
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
-
|
3
|
-
[Home](./index.md) > [koatty](./koatty.md) > [BaseController](./koatty.basecontroller.md) > [(constructor)](./koatty.basecontroller._constructor_.md)
|
4
|
-
|
5
|
-
## BaseController.(constructor)
|
6
|
-
|
7
|
-
instance of BaseController.
|
8
|
-
|
9
|
-
<b>Signature:</b>
|
10
|
-
|
11
|
-
```typescript
|
12
|
-
protected constructor(ctx: KoattyContext);
|
13
|
-
```
|
14
|
-
|
15
|
-
## Parameters
|
16
|
-
|
17
|
-
| Parameter | Type | Description |
|
18
|
-
| --- | --- | --- |
|
19
|
-
| ctx | KoattyContext | BaseController |
|
20
|
-
|
@@ -1,11 +0,0 @@
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
-
|
3
|
-
[Home](./index.md) > [koatty](./koatty.md) > [BaseController](./koatty.basecontroller.md) > [\_options](./koatty.basecontroller._options.md)
|
4
|
-
|
5
|
-
## BaseController.\_options property
|
6
|
-
|
7
|
-
<b>Signature:</b>
|
8
|
-
|
9
|
-
```typescript
|
10
|
-
protected _options: ObjectDefinitionOptions;
|
11
|
-
```
|
@@ -1,11 +0,0 @@
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
-
|
3
|
-
[Home](./index.md) > [koatty](./koatty.md) > [BaseController](./koatty.basecontroller.md) > [app](./koatty.basecontroller.app.md)
|
4
|
-
|
5
|
-
## BaseController.app property
|
6
|
-
|
7
|
-
<b>Signature:</b>
|
8
|
-
|
9
|
-
```typescript
|
10
|
-
app: Koatty;
|
11
|
-
```
|
@@ -1,11 +0,0 @@
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
-
|
3
|
-
[Home](./index.md) > [koatty](./koatty.md) > [BaseController](./koatty.basecontroller.md) > [ctx](./koatty.basecontroller.ctx.md)
|
4
|
-
|
5
|
-
## BaseController.ctx property
|
6
|
-
|
7
|
-
<b>Signature:</b>
|
8
|
-
|
9
|
-
```typescript
|
10
|
-
readonly ctx: KoattyContext;
|
11
|
-
```
|
@@ -1,28 +0,0 @@
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
-
|
3
|
-
[Home](./index.md) > [koatty](./koatty.md) > [BaseController](./koatty.basecontroller.md) > [fail](./koatty.basecontroller.fail.md)
|
4
|
-
|
5
|
-
## BaseController.fail() method
|
6
|
-
|
7
|
-
Response to normalize json format content for fail
|
8
|
-
|
9
|
-
<b>Signature:</b>
|
10
|
-
|
11
|
-
```typescript
|
12
|
-
fail(msg: Error | string | ApiInput, data?: any, code?: number): any;
|
13
|
-
```
|
14
|
-
|
15
|
-
## Parameters
|
16
|
-
|
17
|
-
| Parameter | Type | Description |
|
18
|
-
| --- | --- | --- |
|
19
|
-
| msg | Error \| string \| [ApiInput](./koatty.apiinput.md) | |
|
20
|
-
| data | any | |
|
21
|
-
| code | number | |
|
22
|
-
|
23
|
-
<b>Returns:</b>
|
24
|
-
|
25
|
-
any
|
26
|
-
|
27
|
-
{<!-- -->\*<!-- -->} BaseController
|
28
|
-
|
@@ -1,19 +0,0 @@
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
-
|
3
|
-
[Home](./index.md) > [koatty](./koatty.md) > [BaseController](./koatty.basecontroller.md) > [init](./koatty.basecontroller.init.md)
|
4
|
-
|
5
|
-
## BaseController.init() method
|
6
|
-
|
7
|
-
init
|
8
|
-
|
9
|
-
BaseController
|
10
|
-
|
11
|
-
<b>Signature:</b>
|
12
|
-
|
13
|
-
```typescript
|
14
|
-
protected init(): void;
|
15
|
-
```
|
16
|
-
<b>Returns:</b>
|
17
|
-
|
18
|
-
void
|
19
|
-
|
@@ -1,39 +0,0 @@
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
-
|
3
|
-
[Home](./index.md) > [koatty](./koatty.md) > [BaseController](./koatty.basecontroller.md)
|
4
|
-
|
5
|
-
## BaseController class
|
6
|
-
|
7
|
-
Base controller
|
8
|
-
|
9
|
-
BaseController {<!-- -->IController<!-- -->}
|
10
|
-
|
11
|
-
<b>Signature:</b>
|
12
|
-
|
13
|
-
```typescript
|
14
|
-
export declare class BaseController implements IController
|
15
|
-
```
|
16
|
-
<b>Implements:</b> [IController](./koatty.icontroller.md)
|
17
|
-
|
18
|
-
## Constructors
|
19
|
-
|
20
|
-
| Constructor | Modifiers | Description |
|
21
|
-
| --- | --- | --- |
|
22
|
-
| [(constructor)(ctx)](./koatty.basecontroller._constructor_.md) | | instance of BaseController. |
|
23
|
-
|
24
|
-
## Properties
|
25
|
-
|
26
|
-
| Property | Modifiers | Type | Description |
|
27
|
-
| --- | --- | --- | --- |
|
28
|
-
| [\_options](./koatty.basecontroller._options.md) | | ObjectDefinitionOptions | |
|
29
|
-
| [app](./koatty.basecontroller.app.md) | | Koatty | |
|
30
|
-
| [ctx](./koatty.basecontroller.ctx.md) | | KoattyContext | |
|
31
|
-
|
32
|
-
## Methods
|
33
|
-
|
34
|
-
| Method | Modifiers | Description |
|
35
|
-
| --- | --- | --- |
|
36
|
-
| [fail(msg, data, code)](./koatty.basecontroller.fail.md) | | Response to normalize json format content for fail |
|
37
|
-
| [init()](./koatty.basecontroller.init.md) | | init BaseController |
|
38
|
-
| [ok(msg, data, code)](./koatty.basecontroller.ok.md) | | Response to normalize json format content for success |
|
39
|
-
|
@@ -1,28 +0,0 @@
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
-
|
3
|
-
[Home](./index.md) > [koatty](./koatty.md) > [BaseController](./koatty.basecontroller.md) > [ok](./koatty.basecontroller.ok.md)
|
4
|
-
|
5
|
-
## BaseController.ok() method
|
6
|
-
|
7
|
-
Response to normalize json format content for success
|
8
|
-
|
9
|
-
<b>Signature:</b>
|
10
|
-
|
11
|
-
```typescript
|
12
|
-
ok(msg: string | ApiInput, data?: any, code?: number): Promise<ApiOutput>;
|
13
|
-
```
|
14
|
-
|
15
|
-
## Parameters
|
16
|
-
|
17
|
-
| Parameter | Type | Description |
|
18
|
-
| --- | --- | --- |
|
19
|
-
| msg | string \| [ApiInput](./koatty.apiinput.md) | 待处理的message消息 |
|
20
|
-
| data | any | 待处理的数据 |
|
21
|
-
| code | number | 错误码,默认0 |
|
22
|
-
|
23
|
-
<b>Returns:</b>
|
24
|
-
|
25
|
-
Promise<[ApiOutput](./koatty.apioutput.md)<!-- -->>
|
26
|
-
|
27
|
-
{<!-- -->\*<!-- -->} BaseController
|
28
|
-
|
@@ -1,20 +0,0 @@
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
-
|
3
|
-
[Home](./index.md) > [koatty](./koatty.md) > [BaseService](./koatty.baseservice.md) > [(constructor)](./koatty.baseservice._constructor_.md)
|
4
|
-
|
5
|
-
## BaseService.(constructor)
|
6
|
-
|
7
|
-
instance of Base.
|
8
|
-
|
9
|
-
<b>Signature:</b>
|
10
|
-
|
11
|
-
```typescript
|
12
|
-
protected constructor(...arg: any[]);
|
13
|
-
```
|
14
|
-
|
15
|
-
## Parameters
|
16
|
-
|
17
|
-
| Parameter | Type | Description |
|
18
|
-
| --- | --- | --- |
|
19
|
-
| arg | any\[\] | Base |
|
20
|
-
|
@@ -1,11 +0,0 @@
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
-
|
3
|
-
[Home](./index.md) > [koatty](./koatty.md) > [BaseService](./koatty.baseservice.md) > [\_options](./koatty.baseservice._options.md)
|
4
|
-
|
5
|
-
## BaseService.\_options property
|
6
|
-
|
7
|
-
<b>Signature:</b>
|
8
|
-
|
9
|
-
```typescript
|
10
|
-
protected _options: ObjectDefinitionOptions;
|
11
|
-
```
|
@@ -1,11 +0,0 @@
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
-
|
3
|
-
[Home](./index.md) > [koatty](./koatty.md) > [BaseService](./koatty.baseservice.md) > [app](./koatty.baseservice.app.md)
|
4
|
-
|
5
|
-
## BaseService.app property
|
6
|
-
|
7
|
-
<b>Signature:</b>
|
8
|
-
|
9
|
-
```typescript
|
10
|
-
app: Koatty;
|
11
|
-
```
|
@@ -1,25 +0,0 @@
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
-
|
3
|
-
[Home](./index.md) > [koatty](./koatty.md) > [BaseService](./koatty.baseservice.md) > [init](./koatty.baseservice.init.md)
|
4
|
-
|
5
|
-
## BaseService.init() method
|
6
|
-
|
7
|
-
init
|
8
|
-
|
9
|
-
|
10
|
-
<b>Signature:</b>
|
11
|
-
|
12
|
-
```typescript
|
13
|
-
protected init(...arg: any[]): void;
|
14
|
-
```
|
15
|
-
|
16
|
-
## Parameters
|
17
|
-
|
18
|
-
| Parameter | Type | Description |
|
19
|
-
| --- | --- | --- |
|
20
|
-
| arg | any\[\] | Base |
|
21
|
-
|
22
|
-
<b>Returns:</b>
|
23
|
-
|
24
|
-
void
|
25
|
-
|
@@ -1,36 +0,0 @@
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
-
|
3
|
-
[Home](./index.md) > [koatty](./koatty.md) > [BaseService](./koatty.baseservice.md)
|
4
|
-
|
5
|
-
## BaseService class
|
6
|
-
|
7
|
-
Base class
|
8
|
-
|
9
|
-
Base
|
10
|
-
|
11
|
-
<b>Signature:</b>
|
12
|
-
|
13
|
-
```typescript
|
14
|
-
export declare class BaseService implements IService
|
15
|
-
```
|
16
|
-
<b>Implements:</b> [IService](./koatty.iservice.md)
|
17
|
-
|
18
|
-
## Constructors
|
19
|
-
|
20
|
-
| Constructor | Modifiers | Description |
|
21
|
-
| --- | --- | --- |
|
22
|
-
| [(constructor)(arg)](./koatty.baseservice._constructor_.md) | | instance of Base. |
|
23
|
-
|
24
|
-
## Properties
|
25
|
-
|
26
|
-
| Property | Modifiers | Type | Description |
|
27
|
-
| --- | --- | --- | --- |
|
28
|
-
| [\_options](./koatty.baseservice._options.md) | | ObjectDefinitionOptions | |
|
29
|
-
| [app](./koatty.baseservice.app.md) | | Koatty | |
|
30
|
-
|
31
|
-
## Methods
|
32
|
-
|
33
|
-
| Method | Modifiers | Description |
|
34
|
-
| --- | --- | --- |
|
35
|
-
| [init(arg)](./koatty.baseservice.init.md) | | init |
|
36
|
-
|
@@ -1,26 +0,0 @@
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
-
|
3
|
-
[Home](./index.md) > [koatty](./koatty.md) > [BindAppReadyHook](./koatty.bindappreadyhook.md)
|
4
|
-
|
5
|
-
## BindAppReadyHook() function
|
6
|
-
|
7
|
-
bind AppReadyHookFunc example: export function TestDecorator(): ClassDecorator { return (target: any) =<!-- -->> { BindAppReadyHook((app: Koatty) =<!-- -->> { // todo return Promise.resolve(); }<!-- -->, target) } }
|
8
|
-
|
9
|
-
|
10
|
-
<b>Signature:</b>
|
11
|
-
|
12
|
-
```typescript
|
13
|
-
export declare function BindAppReadyHook(func: AppReadyHookFunc, target: any): void;
|
14
|
-
```
|
15
|
-
|
16
|
-
## Parameters
|
17
|
-
|
18
|
-
| Parameter | Type | Description |
|
19
|
-
| --- | --- | --- |
|
20
|
-
| func | [AppReadyHookFunc](./koatty.appreadyhookfunc.md) | |
|
21
|
-
| target | any | |
|
22
|
-
|
23
|
-
<b>Returns:</b>
|
24
|
-
|
25
|
-
void
|
26
|
-
|
@@ -1,27 +0,0 @@
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
-
|
3
|
-
[Home](./index.md) > [koatty](./koatty.md) > [Bootstrap](./koatty.bootstrap.md)
|
4
|
-
|
5
|
-
## Bootstrap() function
|
6
|
-
|
7
|
-
Bootstrap application
|
8
|
-
|
9
|
-
|
10
|
-
<b>Signature:</b>
|
11
|
-
|
12
|
-
```typescript
|
13
|
-
export declare function Bootstrap(bootFunc?: Function): ClassDecorator;
|
14
|
-
```
|
15
|
-
|
16
|
-
## Parameters
|
17
|
-
|
18
|
-
| Parameter | Type | Description |
|
19
|
-
| --- | --- | --- |
|
20
|
-
| bootFunc | Function | |
|
21
|
-
|
22
|
-
<b>Returns:</b>
|
23
|
-
|
24
|
-
ClassDecorator
|
25
|
-
|
26
|
-
{<!-- -->ClassDecorator<!-- -->}
|
27
|
-
|
@@ -1,27 +0,0 @@
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
-
|
3
|
-
[Home](./index.md) > [koatty](./koatty.md) > [Component](./koatty.component.md)
|
4
|
-
|
5
|
-
## Component() function
|
6
|
-
|
7
|
-
Indicates that an decorated class is a "component".
|
8
|
-
|
9
|
-
|
10
|
-
<b>Signature:</b>
|
11
|
-
|
12
|
-
```typescript
|
13
|
-
export declare function Component(identifier?: string): ClassDecorator;
|
14
|
-
```
|
15
|
-
|
16
|
-
## Parameters
|
17
|
-
|
18
|
-
| Parameter | Type | Description |
|
19
|
-
| --- | --- | --- |
|
20
|
-
| identifier | string | component name |
|
21
|
-
|
22
|
-
<b>Returns:</b>
|
23
|
-
|
24
|
-
ClassDecorator
|
25
|
-
|
26
|
-
{<!-- -->ClassDecorator<!-- -->}
|
27
|
-
|
@@ -1,27 +0,0 @@
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
-
|
3
|
-
[Home](./index.md) > [koatty](./koatty.md) > [ComponentScan](./koatty.componentscan.md)
|
4
|
-
|
5
|
-
## ComponentScan() function
|
6
|
-
|
7
|
-
Define project scan path
|
8
|
-
|
9
|
-
|
10
|
-
<b>Signature:</b>
|
11
|
-
|
12
|
-
```typescript
|
13
|
-
export declare function ComponentScan(scanPath?: string | string[]): ClassDecorator;
|
14
|
-
```
|
15
|
-
|
16
|
-
## Parameters
|
17
|
-
|
18
|
-
| Parameter | Type | Description |
|
19
|
-
| --- | --- | --- |
|
20
|
-
| scanPath | string \| string\[\] | |
|
21
|
-
|
22
|
-
<b>Returns:</b>
|
23
|
-
|
24
|
-
ClassDecorator
|
25
|
-
|
26
|
-
{<!-- -->ClassDecorator<!-- -->}
|
27
|
-
|
@@ -1,27 +0,0 @@
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
-
|
3
|
-
[Home](./index.md) > [koatty](./koatty.md) > [ConfigurationScan](./koatty.configurationscan.md)
|
4
|
-
|
5
|
-
## ConfigurationScan() function
|
6
|
-
|
7
|
-
Define project configuration scan path
|
8
|
-
|
9
|
-
|
10
|
-
<b>Signature:</b>
|
11
|
-
|
12
|
-
```typescript
|
13
|
-
export declare function ConfigurationScan(scanPath?: string | string[]): ClassDecorator;
|
14
|
-
```
|
15
|
-
|
16
|
-
## Parameters
|
17
|
-
|
18
|
-
| Parameter | Type | Description |
|
19
|
-
| --- | --- | --- |
|
20
|
-
| scanPath | string \| string\[\] | |
|
21
|
-
|
22
|
-
<b>Returns:</b>
|
23
|
-
|
24
|
-
ClassDecorator
|
25
|
-
|
26
|
-
{<!-- -->ClassDecorator<!-- -->}
|
27
|
-
|
@@ -1,27 +0,0 @@
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
-
|
3
|
-
[Home](./index.md) > [koatty](./koatty.md) > [Controller](./koatty.controller.md)
|
4
|
-
|
5
|
-
## Controller() function
|
6
|
-
|
7
|
-
Indicates that an decorated class is a "controller".
|
8
|
-
|
9
|
-
|
10
|
-
<b>Signature:</b>
|
11
|
-
|
12
|
-
```typescript
|
13
|
-
export declare function Controller(path?: string): ClassDecorator;
|
14
|
-
```
|
15
|
-
|
16
|
-
## Parameters
|
17
|
-
|
18
|
-
| Parameter | Type | Description |
|
19
|
-
| --- | --- | --- |
|
20
|
-
| path | string | controller router path |
|
21
|
-
|
22
|
-
<b>Returns:</b>
|
23
|
-
|
24
|
-
ClassDecorator
|
25
|
-
|
26
|
-
{<!-- -->ClassDecorator<!-- -->}
|
27
|
-
|
@@ -1,28 +0,0 @@
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
-
|
3
|
-
[Home](./index.md) > [koatty](./koatty.md) > [HttpController](./koatty.httpcontroller.md) > [body](./koatty.httpcontroller.body.md)
|
4
|
-
|
5
|
-
## HttpController.body() method
|
6
|
-
|
7
|
-
Set response Body content
|
8
|
-
|
9
|
-
<b>Signature:</b>
|
10
|
-
|
11
|
-
```typescript
|
12
|
-
body(data: any, contentType?: string, encoding?: string): Promise<any>;
|
13
|
-
```
|
14
|
-
|
15
|
-
## Parameters
|
16
|
-
|
17
|
-
| Parameter | Type | Description |
|
18
|
-
| --- | --- | --- |
|
19
|
-
| data | any | |
|
20
|
-
| contentType | string | |
|
21
|
-
| encoding | string | |
|
22
|
-
|
23
|
-
<b>Returns:</b>
|
24
|
-
|
25
|
-
Promise<any>
|
26
|
-
|
27
|
-
{<!-- -->Promise<any>} HttpController
|
28
|
-
|
@@ -1,26 +0,0 @@
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
-
|
3
|
-
[Home](./index.md) > [koatty](./koatty.md) > [HttpController](./koatty.httpcontroller.md) > [deny](./koatty.httpcontroller.deny.md)
|
4
|
-
|
5
|
-
## HttpController.deny() method
|
6
|
-
|
7
|
-
Block access
|
8
|
-
|
9
|
-
<b>Signature:</b>
|
10
|
-
|
11
|
-
```typescript
|
12
|
-
deny(code?: number): Promise<any>;
|
13
|
-
```
|
14
|
-
|
15
|
-
## Parameters
|
16
|
-
|
17
|
-
| Parameter | Type | Description |
|
18
|
-
| --- | --- | --- |
|
19
|
-
| code | number | |
|
20
|
-
|
21
|
-
<b>Returns:</b>
|
22
|
-
|
23
|
-
Promise<any>
|
24
|
-
|
25
|
-
{<!-- -->Promise<any>} HttpController
|
26
|
-
|
@@ -1,26 +0,0 @@
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
-
|
3
|
-
[Home](./index.md) > [koatty](./koatty.md) > [HttpController](./koatty.httpcontroller.md) > [expires](./koatty.httpcontroller.expires.md)
|
4
|
-
|
5
|
-
## HttpController.expires() method
|
6
|
-
|
7
|
-
set cache-control and expires header
|
8
|
-
|
9
|
-
<b>Signature:</b>
|
10
|
-
|
11
|
-
```typescript
|
12
|
-
expires(timeout?: number): void;
|
13
|
-
```
|
14
|
-
|
15
|
-
## Parameters
|
16
|
-
|
17
|
-
| Parameter | Type | Description |
|
18
|
-
| --- | --- | --- |
|
19
|
-
| timeout | number | |
|
20
|
-
|
21
|
-
<b>Returns:</b>
|
22
|
-
|
23
|
-
void
|
24
|
-
|
25
|
-
{<!-- -->void<!-- -->} HttpController
|
26
|
-
|
@@ -1,28 +0,0 @@
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
-
|
3
|
-
[Home](./index.md) > [koatty](./koatty.md) > [HttpController](./koatty.httpcontroller.md) > [fail](./koatty.httpcontroller.fail.md)
|
4
|
-
|
5
|
-
## HttpController.fail() method
|
6
|
-
|
7
|
-
Response to normalize json format content for fail
|
8
|
-
|
9
|
-
<b>Signature:</b>
|
10
|
-
|
11
|
-
```typescript
|
12
|
-
fail(msg: Error | string | ApiInput, data?: any, code?: number): Promise<any>;
|
13
|
-
```
|
14
|
-
|
15
|
-
## Parameters
|
16
|
-
|
17
|
-
| Parameter | Type | Description |
|
18
|
-
| --- | --- | --- |
|
19
|
-
| msg | Error \| string \| [ApiInput](./koatty.apiinput.md) | |
|
20
|
-
| data | any | |
|
21
|
-
| code | number | |
|
22
|
-
|
23
|
-
<b>Returns:</b>
|
24
|
-
|
25
|
-
Promise<any>
|
26
|
-
|
27
|
-
{<!-- -->\*<!-- -->} HttpController
|
28
|
-
|
@@ -1,27 +0,0 @@
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
-
|
3
|
-
[Home](./index.md) > [koatty](./koatty.md) > [HttpController](./koatty.httpcontroller.md) > [header](./koatty.httpcontroller.header.md)
|
4
|
-
|
5
|
-
## HttpController.header() method
|
6
|
-
|
7
|
-
Get/Set headers.
|
8
|
-
|
9
|
-
<b>Signature:</b>
|
10
|
-
|
11
|
-
```typescript
|
12
|
-
header(name?: string, value?: any): any;
|
13
|
-
```
|
14
|
-
|
15
|
-
## Parameters
|
16
|
-
|
17
|
-
| Parameter | Type | Description |
|
18
|
-
| --- | --- | --- |
|
19
|
-
| name | string | |
|
20
|
-
| value | any | |
|
21
|
-
|
22
|
-
<b>Returns:</b>
|
23
|
-
|
24
|
-
any
|
25
|
-
|
26
|
-
{<!-- -->\*<!-- -->} HttpController
|
27
|
-
|
@@ -1,19 +0,0 @@
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
-
|
3
|
-
[Home](./index.md) > [koatty](./koatty.md) > [HttpController](./koatty.httpcontroller.md) > [isGet](./koatty.httpcontroller.isget.md)
|
4
|
-
|
5
|
-
## HttpController.isGet() method
|
6
|
-
|
7
|
-
Whether it is a GET request
|
8
|
-
|
9
|
-
<b>Signature:</b>
|
10
|
-
|
11
|
-
```typescript
|
12
|
-
isGet(): boolean;
|
13
|
-
```
|
14
|
-
<b>Returns:</b>
|
15
|
-
|
16
|
-
boolean
|
17
|
-
|
18
|
-
{<!-- -->boolean<!-- -->} HttpController
|
19
|
-
|
@@ -1,26 +0,0 @@
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
-
|
3
|
-
[Home](./index.md) > [koatty](./koatty.md) > [HttpController](./koatty.httpcontroller.md) > [isMethod](./koatty.httpcontroller.ismethod.md)
|
4
|
-
|
5
|
-
## HttpController.isMethod() method
|
6
|
-
|
7
|
-
Determines whether the METHOD request is specified
|
8
|
-
|
9
|
-
<b>Signature:</b>
|
10
|
-
|
11
|
-
```typescript
|
12
|
-
isMethod(method: string): boolean;
|
13
|
-
```
|
14
|
-
|
15
|
-
## Parameters
|
16
|
-
|
17
|
-
| Parameter | Type | Description |
|
18
|
-
| --- | --- | --- |
|
19
|
-
| method | string | |
|
20
|
-
|
21
|
-
<b>Returns:</b>
|
22
|
-
|
23
|
-
boolean
|
24
|
-
|
25
|
-
{<!-- -->boolean<!-- -->} HttpController
|
26
|
-
|
@@ -1,19 +0,0 @@
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
-
|
3
|
-
[Home](./index.md) > [koatty](./koatty.md) > [HttpController](./koatty.httpcontroller.md) > [isPost](./koatty.httpcontroller.ispost.md)
|
4
|
-
|
5
|
-
## HttpController.isPost() method
|
6
|
-
|
7
|
-
Whether it is a POST request
|
8
|
-
|
9
|
-
<b>Signature:</b>
|
10
|
-
|
11
|
-
```typescript
|
12
|
-
isPost(): boolean;
|
13
|
-
```
|
14
|
-
<b>Returns:</b>
|
15
|
-
|
16
|
-
boolean
|
17
|
-
|
18
|
-
{<!-- -->boolean<!-- -->} HttpController
|
19
|
-
|