You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/reference/server-adapters/nestjs.mdx
+145Lines changed: 145 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -66,6 +66,97 @@ export class MyController {
66
66
67
67
You can still use the regular Prisma service by injecting as usual.
68
68
69
+
### Using the API handler service to automate request handling
70
+
71
+
This module also provides an `ApiHandlerService` that can be used to automate the request handling using API handlers. This is useful if you want to handle requests in a more structured way, such as using a controller or middleware. Before using it, you should ensure `ENHANCED_PRISMA` is registered in the module. For example:
Then, you can inject the `ApiHandlerService` into your code and use it to handle requests. The service provides a method `handleRequest` to handle request using API handler automatically.
98
+
99
+
RPC API Handler:
100
+
101
+
```ts
102
+
import { Controller, Get, Post } from'@nestjs/common';
0 commit comments