@@ -21,6 +21,14 @@ A library that enables Angular Universal applications to generate static pages a
21
21
npm install @rx-angular/isr
22
22
```
23
23
24
+ ## Version Compatibility
25
+
26
+ | RxAngular | Angular |
27
+ | --------- | --------- |
28
+ | ` ^18.0.0 ` | ` ^18.0.0 ` |
29
+ | ` ^17.1.0 ` | ` ^17.0.0 ` |
30
+ | ` ^16.0.0 ` | ` ^16.0.0 ` |
31
+
24
32
## How to use it?
25
33
26
34
1 . Initialize ` ISRHandler ` inside ` server.ts `
@@ -37,10 +45,7 @@ const isr = new ISRHandler({
37
45
38
46
``` ts
39
47
server .use (express .json ());
40
- server .post (
41
- ' /api/invalidate' ,
42
- async (req , res ) => await isr .invalidate (req , res )
43
- );
48
+ server .post (' /api/invalidate' , async (req , res ) => await isr .invalidate (req , res ));
44
49
```
45
50
46
51
3 . Replace Angular default server side rendering with ISR rendering
@@ -64,7 +69,7 @@ server.get(
64
69
// Serve page if it exists in cache
65
70
async (req , res , next ) => await isr .serveFromCache (req , res , next ),
66
71
// Server side render the page and add to cache if needed
67
- async (req , res , next ) => await isr .render (req , res , next )
72
+ async (req , res , next ) => await isr .render (req , res , next ),
68
73
);
69
74
```
70
75
@@ -80,7 +85,7 @@ server.get(
80
85
{ provide: CUSTOM_TOKEN , useValue: ' Hello from ISR' },
81
86
CustomService ,
82
87
],
83
- })
88
+ }),
84
89
);
85
90
```
86
91
@@ -105,7 +110,7 @@ server.get(
105
110
modifyGeneratedHtml : (req , html ) => {
106
111
return ` ${html }<!-- Hello, I'm modifying the generatedHtml before caching it! --> ` ;
107
112
},
108
- })
113
+ }),
109
114
);
110
115
```
111
116
0 commit comments