moost 0.2.27 → 0.2.29
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/README.md +7 -3
- package/dist/index.cjs +622 -205
- package/dist/index.d.ts +242 -16
- package/dist/index.mjs +599 -188
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -12,12 +12,14 @@
|
|
|
12
12
|
Moost is a Metadata driven Web App Framework inspired by [nestjs](https://nestjs.com/) and powered by [wooks](https://github.com/wooksjs/wooks).
|
|
13
13
|
|
|
14
14
|
The main ideas behind Moost are:
|
|
15
|
+
|
|
15
16
|
1. Use the power of TS decorators to describe your app
|
|
16
17
|
2. Use the power of [wooks](https://github.com/wooksjs/wooks) to process events
|
|
17
18
|
3. Make it easier to control dependency injections
|
|
18
19
|
4. Use as less external dependencies as possible
|
|
19
20
|
|
|
20
21
|
What's the difference to [nestjs](https://nestjs.com/)?
|
|
22
|
+
|
|
21
23
|
1. It does not use additional `modules` abstraction
|
|
22
24
|
2. It utilizes reusable dependency injection framework [@prostojs/infact](https://github.com/prostojs/infact)
|
|
23
25
|
3. It uses metadata layer powered by [@prostojs/mate](https://github.com/prostojs/mate)
|
|
@@ -36,13 +38,15 @@ import { Moost, Param } from 'moost'
|
|
|
36
38
|
class MyServer extends Moost {
|
|
37
39
|
@Get('test/:name')
|
|
38
40
|
test(@Param('name') name: string) {
|
|
39
|
-
return { message: `Hello ${
|
|
41
|
+
return { message: `Hello ${name}!` }
|
|
40
42
|
}
|
|
41
43
|
}
|
|
42
44
|
|
|
43
45
|
const app = new MyServer()
|
|
44
46
|
const http = new MoostHttp()
|
|
45
|
-
app.adapter(http).listen(3000, () => {
|
|
47
|
+
app.adapter(http).listen(3000, () => {
|
|
48
|
+
app.getLogger('MyApp').log('Up on port 3000')
|
|
49
|
+
})
|
|
46
50
|
app.init()
|
|
47
51
|
// curl http://localhost:3000/test/World
|
|
48
52
|
// {"message":"Hello World!"}
|
|
@@ -52,4 +56,4 @@ app.init()
|
|
|
52
56
|
|
|
53
57
|
`npm install moost @moostjs/event-http`
|
|
54
58
|
|
|
55
|
-
## To be Documented...
|
|
59
|
+
## To be Documented...
|