quantum-flow 1.1.0 → 1.1.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.
- package/README.md +11 -37
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -16,6 +16,16 @@ yarn build
|
|
|
16
16
|
|
|
17
17
|
# Usage
|
|
18
18
|
|
|
19
|
+
You can use controllers and server functionality by importing controllers and creating server instances as shown in the examples above. Use your preferred testing framework to write unit and integration tests.
|
|
20
|
+
|
|
21
|
+
# Project Structure
|
|
22
|
+
|
|
23
|
+
- `quantum-flow/http` - Main application source code for HTTP servers.
|
|
24
|
+
- `quantum-flow/aws` - Main application source code AWS Lambda.
|
|
25
|
+
- `quantum-flow/core` - Core framework components like Controller and Endpoint.
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
19
29
|
## Defining Controllers
|
|
20
30
|
|
|
21
31
|
Use the `@Controller` decorator to define controllers with options such as prefix, sub-controllers, middlewares, and interceptors.
|
|
@@ -34,7 +44,7 @@ import { Controller } from 'quantum-flow/core';
|
|
|
34
44
|
class RootController {}
|
|
35
45
|
```
|
|
36
46
|
|
|
37
|
-
## Creating a Server
|
|
47
|
+
## Creating a http Server
|
|
38
48
|
|
|
39
49
|
Use the `@Server` decorator with configuration options like port, host, controllers, and WebSocket enablement.
|
|
40
50
|
|
|
@@ -180,44 +190,8 @@ export class Socket {
|
|
|
180
190
|
}
|
|
181
191
|
```
|
|
182
192
|
|
|
183
|
-
# Http server configuration
|
|
184
|
-
|
|
185
|
-
```typescript
|
|
186
|
-
@Server({
|
|
187
|
-
controllers: [Root],
|
|
188
|
-
websocket: { enabled: true },
|
|
189
|
-
interceptor: (data) => data,
|
|
190
|
-
})
|
|
191
|
-
@Port(3000)
|
|
192
|
-
@Use((data) => data)
|
|
193
|
-
@Use((data) => data)
|
|
194
|
-
@Catch((error) => ({ status: 400, error }))
|
|
195
|
-
class App {}
|
|
196
|
-
```
|
|
197
|
-
|
|
198
|
-
# Usage
|
|
199
|
-
|
|
200
|
-
You can use controllers and server functionality by importing controllers and creating server instances as shown in the examples above. Use your preferred testing framework to write unit and integration tests.
|
|
201
|
-
|
|
202
|
-
# Project Structure
|
|
203
|
-
|
|
204
|
-
- `quantum-flow/http` - Main application source code for HTTP servers.
|
|
205
|
-
- `quantum-flow/aws` - Main application source code AWS Lambda.
|
|
206
|
-
- `quantum-flow/core` - Core framework components like Controller and Endpoint.
|
|
207
|
-
|
|
208
|
-
---
|
|
209
|
-
|
|
210
193
|
# Decorators
|
|
211
194
|
|
|
212
|
-
### Server
|
|
213
|
-
|
|
214
|
-
Class decorator to configure the server with options like controllers, global middlewares, and interceptors.
|
|
215
|
-
|
|
216
|
-
```typescript
|
|
217
|
-
@Server({ controllers: [RootController] })
|
|
218
|
-
class App {}
|
|
219
|
-
```
|
|
220
|
-
|
|
221
195
|
### Use
|
|
222
196
|
|
|
223
197
|
Class decorator to add global middlewares to the server.
|