@deepkit/angular-ssr 1.0.1-alpha.158 → 1.0.1-alpha.160

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deepkit/angular-ssr",
3
- "version": "1.0.1-alpha.158",
3
+ "version": "1.0.1-alpha.160",
4
4
  "description": "Deepkit + angular SSR",
5
5
  "type": "commonjs",
6
6
  "main": "./dist/cjs/index.js",
@@ -30,8 +30,8 @@
30
30
  },
31
31
  "devDependencies": {
32
32
  "@angular/ssr": "^19.1.7",
33
- "@deepkit/app": "^1.0.1-alpha.158",
34
- "@deepkit/http": "^1.0.1-alpha.158"
33
+ "@deepkit/app": "^1.0.1-alpha.160",
34
+ "@deepkit/http": "^1.0.1-alpha.160"
35
35
  },
36
36
  "jest": {
37
37
  "transform": {
@@ -44,5 +44,5 @@
44
44
  "**/tests/**/*.spec.ts"
45
45
  ]
46
46
  },
47
- "gitHead": "331127891a3f95cddc6720d64ac0703f90de3d47"
47
+ "gitHead": "52a703a1f6747c59e77cbf44d80d3bc5b1424ee6"
48
48
  }
package/src/angular.ts CHANGED
@@ -11,7 +11,6 @@
11
11
  import {
12
12
  AngularNodeAppEngine,
13
13
  createNodeRequestHandler,
14
- createWebRequestFromNodeRequest,
15
14
  isMainModule,
16
15
  NodeRequestHandlerFunction,
17
16
  writeResponseToNodeResponse,
@@ -76,23 +75,14 @@ class AngularListener {
76
75
  if (event.route) return; //already found
77
76
  if (!_ngApp) return;
78
77
 
79
- const webRequest = createWebRequestFromNodeRequest(event.request);
80
- // @ts-ignore
81
- const serverApp = await ((_ngApp as any).angularAppEngine as AngularAppEngine).getAngularServerAppForRequest(webRequest);
82
- const serverRouter = serverApp.router;
83
- if (serverRouter) {
84
- const matchedRoute = serverRouter.match(new URL(webRequest.url));
85
- if (!matchedRoute) {
86
- //not handled by angular app, so early exit
87
- return;
88
- }
89
- }
78
+ const promise = _ngApp.handle(event.request, this.requestContext);
79
+ if (!promise) return;
90
80
 
91
81
  event.routeFound(new RouteConfig('angular', ['GET'], event.request.url || '', {
92
82
  type: 'function',
93
83
  fn: async (req: HttpRequest, res: HttpResponse) => {
94
84
  if (!_ngApp) return;
95
- const response = await _ngApp.handle(req, this.requestContext);
85
+ const response = await promise;
96
86
  if (!response) {
97
87
  throw new HttpNotFoundError();
98
88
  }