web_api_base 2.5.1 → 2.5.3
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.
|
@@ -0,0 +1 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-webapi-app.js","sourceRoot":"","sources":["../../bin/create-webapi-app.ts"],"names":[],"mappings":";;AAEA,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "web_api_base",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.3",
|
|
4
4
|
"description": "web api base",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -13,6 +13,10 @@
|
|
|
13
13
|
"transpile": "tsc -p tsconfig.json",
|
|
14
14
|
"run:tests": "npx jest"
|
|
15
15
|
},
|
|
16
|
+
"bin":
|
|
17
|
+
{
|
|
18
|
+
"runs" : "./dist/bin/create-webapi-app.js"
|
|
19
|
+
},
|
|
16
20
|
"author": "adriano.marino1992@gmail.com",
|
|
17
21
|
"repository": "https://github.com/adrianomarino1992/web_api_base.git",
|
|
18
22
|
"license": "ISC",
|
package/readme.md
CHANGED
|
@@ -14,9 +14,9 @@ npm install web_api_base
|
|
|
14
14
|
## Usage
|
|
15
15
|
|
|
16
16
|
First of all we need implement the abstract class __Application__.
|
|
17
|
-
After that, we need to create some controllers and
|
|
17
|
+
After that, we need to create some controllers and they must inherit the abstract class __ControllerBase__.
|
|
18
18
|
|
|
19
|
-
### SampleController.ts
|
|
19
|
+
### ./controllers/SampleController.ts
|
|
20
20
|
|
|
21
21
|
```typescript
|
|
22
22
|
|
|
@@ -67,9 +67,22 @@ export default class App extends Application
|
|
|
67
67
|
|
|
68
68
|
//register in DI service
|
|
69
69
|
DependecyService.Register(SampleController);
|
|
70
|
+
|
|
71
|
+
*/
|
|
72
|
+
if the controlles follow the naming rules, the method UseControllers will automatically append them
|
|
73
|
+
|
|
74
|
+
rootDir -
|
|
75
|
+
|
|
|
76
|
+
| - controllers -
|
|
77
|
+
| - <Name>Controller.ts
|
|
78
|
+
|
|
|
79
|
+
| - App.ts //the class that inherit the Application
|
|
80
|
+
|
|
81
|
+
*/
|
|
82
|
+
this.UseControllers();
|
|
70
83
|
|
|
71
|
-
//
|
|
72
|
-
ControllerBase.AppendController(SampleController,this);
|
|
84
|
+
//if not, we can append manually using the method bellow
|
|
85
|
+
//ControllerBase.AppendController(SampleController,this);
|
|
73
86
|
|
|
74
87
|
}
|
|
75
88
|
}
|