Skip to content

Commit 1967b06

Browse files
committed
add allowedHosts and trustedProxyHeaders
1 parent 8ee6796 commit 1967b06

10 files changed

Lines changed: 821 additions & 1420 deletions

README.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -119,16 +119,16 @@ If you are using Angular 20 or Angular 19 with App Engine Developer Preview:
119119
```ts
120120
import { AngularAppEngine, createRequestHandler } from '@angular/ssr'
121121
import { getContext } from '@netlify/angular-runtime/context.js'
122+
import type { Context } from '@netlify/edge-functions'
122123

123124
const angularAppEngine = new AngularAppEngine()
124125

125126
export async function netlifyAppEngineHandler(request: Request): Promise<Response> {
126-
const context = getContext()
127+
const context: Context = getContext()
127128

128129
// Example API endpoints can be defined here.
129130
// Uncomment and define endpoints as necessary.
130-
// const pathname = new URL(request.url).pathname;
131-
// if (pathname === '/api/hello') {
131+
// if (context.url.pathname === '/api/hello') {
132132
// return Response.json({ message: 'Hello from the API' });
133133
// }
134134

@@ -147,14 +147,14 @@ If you are using Angular 19 and did not opt into the App Engine Developer Previe
147147
```ts
148148
import { CommonEngine } from '@angular/ssr/node'
149149
import { render } from '@netlify/angular-runtime/common-engine.js'
150+
import type { Context } from '@netlify/edge-functions'
150151

151152
const commonEngine = new CommonEngine()
152153

153-
export async function netlifyCommonEngineHandler(request: Request, context: any): Promise<Response> {
154+
export async function netlifyCommonEngineHandler(request: Request, context: Context): Promise<Response> {
154155
// Example API endpoints can be defined here.
155156
// Uncomment and define endpoints as necessary.
156-
// const pathname = new URL(request.url).pathname;
157-
// if (pathname === '/api/hello') {
157+
// if (context.url.pathname === '/api/hello') {
158158
// return Response.json({ message: 'Hello from the API' });
159159
// }
160160

@@ -183,8 +183,6 @@ The [`server.ts` file](https://angular.dev/guide/ssr#configure-server-side-rende
183183

184184
To use the Angular Runtime while building and deploying with the CLI, you need to have `netlify-cli v26.0.0` installed (or a later version).
185185

186-
Please also make sure to use `ntl deploy --build` (rather than `ntl build && ntl deploy`).
187-
188186
## Getting Help
189187

190188
We love to hear from you so if you have questions, comments or find a bug in the

0 commit comments

Comments
 (0)