Skip to content

Commit

Permalink
Explain what Express wrapper does
Browse files Browse the repository at this point in the history
  • Loading branch information
hansott committed Feb 14, 2024
1 parent c368875 commit 433c4e2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions library/src/sources/Express.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ function createMiddleware(): Middleware {
}

export class Express implements Wrapper {
// Whenever app.get, app.post, etc. is called, we want to inject our middleware
// So that runWithContext is called for every request
// Whenever a MongoDB query is made, we want to inspect the filter
// And cross-reference it with the user supplied data of the request
private wrapRouteMethods(exports: unknown) {
massWrap(
// @ts-expect-error This is magic that TypeScript doesn't understand
Expand Down

0 comments on commit 433c4e2

Please sign in to comment.