quantum-flow 1.0.4 → 1.0.5
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 +17 -15
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -21,7 +21,7 @@ yarn build
|
|
|
21
21
|
Use the `@Controller` decorator to define controllers with options such as prefix, sub-controllers, middlewares, and interceptors.
|
|
22
22
|
|
|
23
23
|
```typescript
|
|
24
|
-
import { Controller } from '
|
|
24
|
+
import { Controller } from 'quantum-flow/core';
|
|
25
25
|
|
|
26
26
|
@Controller({
|
|
27
27
|
prefix: 'api',
|
|
@@ -36,7 +36,7 @@ class RootController {}
|
|
|
36
36
|
Use the `@Server` decorator with configuration options like port, host, controllers, and WebSocket enablement.
|
|
37
37
|
|
|
38
38
|
```typescript
|
|
39
|
-
import { Server, Port, Host, Use, Intercept, Catch, HttpServer } from '
|
|
39
|
+
import { Server, Port, Host, Use, Intercept, Catch, HttpServer } from 'quantum-flow/http';
|
|
40
40
|
|
|
41
41
|
@Server({
|
|
42
42
|
controllers: [RootController],
|
|
@@ -62,22 +62,24 @@ server.listen().catch(console.error);
|
|
|
62
62
|
|
|
63
63
|
## Request decorators
|
|
64
64
|
|
|
65
|
-
- Use `@Body` to
|
|
66
|
-
- Use `@Headers` to
|
|
67
|
-
- Use `@Query` to handle
|
|
68
|
-
- Use `@Params`
|
|
69
|
-
- Use `@
|
|
70
|
-
- Use `@
|
|
71
|
-
- Use `@
|
|
65
|
+
- Use `@Body` to handle request bodies.
|
|
66
|
+
- Use `@Headers` to access request headers.
|
|
67
|
+
- Use `@Query` to handle query parameters.
|
|
68
|
+
- Use `@Params` to access route parameters.
|
|
69
|
+
- Use `@Host` to configure the server host.
|
|
70
|
+
- Use `@Port` to configure the server port.
|
|
71
|
+
- Use `@Multipart` for handling multipart/form-data requests.
|
|
72
|
+
- Use `@Request` to access the entire request object.
|
|
73
|
+
- Use `@Response` to access the response object.
|
|
72
74
|
|
|
73
75
|
# AWS Lambda Support
|
|
74
76
|
|
|
75
77
|
Use `LambdaAdapter` to convert API Gateway events to requests and responses. Create Lambda handlers from controllers.
|
|
76
78
|
|
|
77
79
|
```typescript
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
80
|
+
Example Lambda handler creation
|
|
81
|
+
import { LambdaAdapter } from 'quantum-flow/aws';
|
|
82
|
+
export const handler = LambdaAdapter.createHandler(RootController);
|
|
81
83
|
```
|
|
82
84
|
|
|
83
85
|
# WebSocket Support
|
|
@@ -177,9 +179,9 @@ You can use controllers and server functionality by importing controllers and cr
|
|
|
177
179
|
|
|
178
180
|
# Project Structure
|
|
179
181
|
|
|
180
|
-
- `
|
|
181
|
-
- `
|
|
182
|
-
- `
|
|
182
|
+
- `quantum-flow/http` - Main application source code for HTTP servers.
|
|
183
|
+
- `quantum-flow/aws` - Main application source code AWS Lambda.
|
|
184
|
+
- `quantum-flow/core` - Core framework components like Controller and Endpoint.
|
|
183
185
|
|
|
184
186
|
---
|
|
185
187
|
|