@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/CHANGELOG.md +6 -0
- package/dist/cjs/src/angular.js +4 -12
- package/dist/cjs/src/angular.js.map +1 -1
- package/dist/cjs/tsconfig.tsbuildinfo +1 -1
- package/dist/esm/src/angular.js +5 -13
- package/dist/esm/src/angular.js.map +1 -1
- package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/src/angular.ts +3 -13
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepkit/angular-ssr",
|
|
3
|
-
"version": "1.0.1-alpha.
|
|
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.
|
|
34
|
-
"@deepkit/http": "^1.0.1-alpha.
|
|
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": "
|
|
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
|
|
80
|
-
|
|
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
|
|
85
|
+
const response = await promise;
|
|
96
86
|
if (!response) {
|
|
97
87
|
throw new HttpNotFoundError();
|
|
98
88
|
}
|