From e6b687b041ecac8c53c268d5d2b838e902e01782 Mon Sep 17 00:00:00 2001 From: lenny Date: Sat, 23 Nov 2024 13:18:39 +0100 Subject: [PATCH] feat: update docs --- README.md | 8 ++++++++ angular.json | 2 +- projects/example/src/app/app.config.server.ts | 6 +++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c5d8175..7a7ddb9 100644 --- a/README.md +++ b/README.md @@ -70,6 +70,14 @@ export class DemoComponent { } ``` +## Known Issues +* **Headers are not forwarded when performing requests in ssr.** + + _Add this provider to your `app.config.server.ts` file to fix this issue:_ + ```typescript + provideServerRoutesConfig([{path: '**', renderMode: RenderMode.Server}]) + ``` + ## TODOs 📝 - [ ] Additional Unit Tests for SSR and WebSocket Subscriptions. diff --git a/angular.json b/angular.json index 2fea3da..1fbd5e6 100644 --- a/angular.json +++ b/angular.json @@ -69,7 +69,7 @@ ], "scripts": [], "server": "projects/example/src/main.server.ts", - "outputMode": "server", + "externalDependencies": [""], "ssr": { "entry": "projects/example/src/server.ts" } diff --git a/projects/example/src/app/app.config.server.ts b/projects/example/src/app/app.config.server.ts index ddd0d86..453274f 100644 --- a/projects/example/src/app/app.config.server.ts +++ b/projects/example/src/app/app.config.server.ts @@ -1,9 +1,13 @@ import {ApplicationConfig, mergeApplicationConfig} from '@angular/core'; import {provideServerRendering} from '@angular/platform-server'; import {appConfig} from './app.config'; +import {provideServerRoutesConfig, RenderMode} from '@angular/ssr'; const serverConfig: ApplicationConfig = { - providers: [provideServerRendering()] + providers: [ + provideServerRendering(), + provideServerRoutesConfig([{path: '**', renderMode: RenderMode.Server}]) + ] }; export const config = mergeApplicationConfig(appConfig, serverConfig);