How do I feed my REST server URL (or other deploy-side variables) into my Angular application?

Discussão em 'Angular' iniciado por Joseph Larson, Maio 5, 2025.

  1. I'm new to Angular. Primarily I'm a server-side developer. I'm building a spring REST server with an Angular front end. I'm don't understand how I can get the URL of the REST server into my Angular app. I can hardcode it, but that doesn't work very well when I deploy.

    I presume -- but maybe there's a better way -- that my REST server will also serve up the Angular app with an index.html, and I can produce the latter on the fly. Thus, I could embed whatever I want into the HTML file, but I don't know how I feed that into my component.

    Maybe there's a different way to do deploys so that the app knows how to preform its REST calls.

    Can someone point me in the right direction?

    Continue reading...

Compartilhe esta Página