angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

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

Open asgerjensen opened this issue 1 year ago • 2 comments

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.

asgerjensen avatar Feb 22 '24 11:02 asgerjensen

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.

angular-robot[bot] avatar Feb 22 '24 13:02 angular-robot[bot]

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

not-nemlig avatar Jul 15 '24 06:07 not-nemlig

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.

asgerjensen avatar Sep 16 '24 10:09 asgerjensen