Node server to intercept all request from angular (http) to java spring backend

I am using express on node for routing and using angular as front end framework. I am using Redis for session. What i want to do is when ever i make http request from angular it should first go to node where i want to add additional headers information like auth token and all than pass it to java(spring) backend.

I want to do this because if i directly pass info from angular http it will be visible in network tab which might be security vulnerability.

So how can i make node interceptor between angular and java back end using node js server?


I used http proxy middleware () for similar purpose. Add it to your express application.

The middleware allows you to subscribe for proxy events and add/remove/modify headers that will go to you spring backend.

If I guess your needs correctly, you also might want to look at for authenticaion management.


 ? Angular change url without executing routeprovider
 ? Angular js - call a route without view
 ? .config $routeprovider angularjs
 ? Angular JS not loading view
 ? AngularJS directive vs routeProvider
 ? controller not found through routeProvider
 ? routeProvider not working correctly
 ? AngularJS redirecting to another ng-app module
 ? Issue in angular js routeProvider
 ? Refreshing browser web-page not load in ui-router when locationProvider used