web_api_base 2.5.0 → 2.5.1

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/readme.md +17 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "web_api_base",
3
- "version": "2.5.0",
3
+ "version": "2.5.1",
4
4
  "description": "web api base",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/readme.md CHANGED
@@ -20,13 +20,22 @@ After that, we need to create some controllers and, they must inherit the abstr
20
20
 
21
21
  ```typescript
22
22
 
23
- import { ControllerBase, ControllersDecorators as CD, HTTPVerbs as verbs } from "web_api_base";
23
+ import { ControllerBase, HTTPVerbs as verbs, Use, Verb, Route, Action } from "web_api_base";
24
+ /*
24
25
 
25
- @CD.Route("/sample")
26
+ we can use this class to acess all decorators centralized
27
+ import { ControllerDecorators as CD } from "web_api_base";
28
+
29
+ */
30
+
31
+ //@CD.Route("/sample")
32
+ @Route("/sample")
26
33
  export default class SampleController extends ControllerBase
27
34
  {
28
- @CD.Verb(verbs.GET)
29
- @CD.Action("/hello")
35
+ //@CD.Verb(verbs.GET)
36
+ @Verb(verbs.GET)
37
+ //@CD.Action("/hello")
38
+ @Action("/hello")
30
39
  public Hello() : void
31
40
  {
32
41
  this.OK({message: "Hello Word!"})
@@ -48,8 +57,10 @@ export default class App extends Application
48
57
 
49
58
  public override Configure(appConfig: IApplicationConfiguration): void
50
59
  {
51
- appConfig.Host = "0.0.0.0";
52
- appConfig.Port = 5555;
60
+ //to define the host use this property, if that property is not changed, the default value will be 0.0.0.0
61
+ appConfig.Host = "127.0.0.1";
62
+ //to define the app port use this property, if that property is not changed, the default value will be 5555
63
+ appConfig.Port = 1234;
53
64
 
54
65
  //allow CORS
55
66
  this.UseCors();