-
Notifications
You must be signed in to change notification settings - Fork 11.9k
feat(@angular/ssr): add getHeaders
method to AngularAppEngine
and AngularNodeAppEngine
for handling pages static headers
#28338
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
getHeaders
method to AngularAppEngine
and AngularNodeAppEngine
for handling pages static headers
f0cfdca
to
bf3c9d2
Compare
getHeaders
method to AngularAppEngine
and AngularNodeAppEngine
for handling pages static headersgetHeaders
method to AngularAppEngine
and AngularNodeAppEngine
for handling pages static headers
64b6ffa
to
1a1fd33
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly looks good, lots of little comments just to make sure I understand the use case and how this fits into the architecture.
b9caedd
to
225436b
Compare
225436b
to
8d53482
Compare
…integration Expose a variant of `AngularAppEngine` tailored for Node.js. These additions streamline the process by minimizing boilerplate code and eliminate the need for users to call `createWebRequestFromNodeRequest` before invoking the render method.
8d53482
to
d658435
Compare
… `AngularNodeAppEngine` for handling pages static headers This commit introduces a new `getHeaders` method to the `AngularAppEngine` and `AngularNodeAppEngine` classes, designed to facilitate the retrieval of HTTP headers based on URL pathnames for statically generated (SSG) pages. ```typescript const angularAppEngine = new AngularNodeAppEngine(); app.use(express.static('dist/browser', { setHeaders: (res, path) => { // Retrieve headers for the current request const headers = angularAppEngine.getHeaders(res.req); // Apply the retrieved headers to the response for (const { key, value } of headers) { res.setHeader(key, value); } } })); ``` In this example, the `getHeaders` method is used within an Express application to dynamically set HTTP headers for static files. This ensures that appropriate headers are applied based on the specific request, enhancing the handling of SSG pages.
d658435
to
559eb72
Compare
559eb72
to
ef72f9c
Compare
This commit removes the singleton helpers and instead exposes the classes directly.
ef72f9c
to
f711e9a
Compare
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
feat(@angular/ssr): Add
getHeaders
Method toAngularAppEngine
andAngularNodeAppEngine
for handling pages static headersThis commit introduces a new
getHeaders
method to theAngularAppEngine
andAngularNodeAppEngine
classes, designed to facilitate the retrieval of HTTP headers based on URL pathnames for statically generated (SSG) pages.In this example, the
getHeaders
method is used within an Express application to dynamically set HTTP headers for static files. This ensures that appropriate headers are applied based on the specific request, enhancing the handling of SSG pages.feat(@angular/ssr): introduce
AngularNodeAppEngine
API for Node.js integrationExpose a variant of
AngularAppEngine
tailored for Node.js. These additions streamline the process by minimizing boilerplate code and eliminate the need for users to callcreateWebRequestFromNodeRequest
before invoking the render method.