Skip to content
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

Support either proxy-conf or use ssr entrypoint for @angular-devkit/build-angular:dev-server #27144

Closed
asgerjensen opened this issue Feb 22, 2024 · 4 comments · Fixed by #28463
Labels
angular/build:dev-server area: @angular/build feature: under consideration Feature request for which voting has completed and the request is now under consideration feature Issue that requests a new feature

Comments

@asgerjensen
Copy link

Command

serve

Description

I have a project using @angular-devkit/build-angular:application as executor.
This project has SSR enabled, via ssr: { entry: 'path/to/file' } and server: path-to-main.server.ts

When i run nx serve it detects that i have SSR enabled, and helpfully starts the server side rendering, by bootstrapping the thing from server path (not the thing from ssr.entry)

I have an external api, that is usually mapped via proxyConf, but this seems not to take effect. Ie the client side requests for /api/ does not get proxied, but rather the requests get sent to the SSR part which then just renders index.html

And since its not using the ssr-entry point to run this server, i cant add, say, an express-proxy to the configuration.

Describe the solution you'd like

I'd like to be able to proxy calls to third party, for browser side calls, on projects that use build-angular:application and build-angular:dev-server

Describe alternatives you've considered

I can inject the true host names for third party service, from server side variables into client side, but this adds CORS overhead and management issues during normal development.

@alan-agius4 alan-agius4 added feature Issue that requests a new feature area: @angular-devkit/build-angular devkit/build-angular:dev-server area: build & ci Related the build and CI infrastructure of the project and removed area: build & ci Related the build and CI infrastructure of the project labels Feb 22, 2024
Copy link
Contributor

angular-robot bot commented Feb 22, 2024

This feature request is now candidate for our backlog! In the next phase, the community has 60 days to upvote. If the request receives more than 20 upvotes, we'll move it to our consideration list.

You can find more details about the feature request process in our documentation.

@not-nemlig
Copy link

@asgerjensen Did you ever find a solution for this, or are you still waiting?

@asgerjensen
Copy link
Author

Still waiting. Although for now, i've just not used proxy-conf and used direct endpoint addresses during test instead.
That, or just run a non-ssr instance when its for design work only.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Oct 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
angular/build:dev-server area: @angular/build feature: under consideration Feature request for which voting has completed and the request is now under consideration feature Issue that requests a new feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants