Your request /hello means the absolute path inside the application using the angular application, so the request is sent to http://localhost:4200/hello . The angular app just doesn't know about the express app you want to target.
absolute urls
If you want to access the hello route in another (express) application, you need to explicitly specify this by specifying http://localhost:8080/hello .
CORS
By doing this, the correct application is targeted, but you are likely to run into CORS problems because the browser will prevent javascript code from localhost:4200 to access the server in localhost:8080 . This is the security feature of your browser. Therefore, if you want to allow 4200 code access to the 8080 backend, your backend can list this so-called origin. For more information, see http://enable-cors.org/ and the corresponding express middleware that you can use to support the roots in your server ( https://www.npmjs.com/package/cors ).
Using this approach has two drawbacks, in my opinion. First, you need a way to tell your interface under which an absolute URL can reach the backend. This has to be customizable because you need different URLs for developers, staging and production. Then you also need a way to manage all your white URLs, because the frontend in production will have a different URL than when working with the frontend in development. This can become quite cumbersome to process.
backend proxy
The best approach, in my opinion, is to deal with this in your infrastructure by proxying backend in your external application. With a proxy server, you basically tell the server of your interface that all requests to some URL should be transferred to another application. In your case, this may mean, for example, that you configure the proxy for the path /api/ to proxy the application to localhost:8080 . Then the server does not try to find the URL, for example /api/hello , in its external application, but redirects your request to localhost:8080/hello . In your angular application, you do not need to care about the URL of your backend, and you can always query the URL, for example /api/some-express-route .
To do this, you need to configure your angular dev server to proxy requests. For more details on how to do this, see the docs https://github.com/angular/angular-cli#proxy-to-backend . When switching to production, you can do this by setting up your web server, for example. nginx for proxying requests.