Letaief Mohamed

Letaief Mohamed

  • NA
  • 11
  • 2.2k

Angular-CLI proxy to spring boot backend doesn't work

Dec 20 2019 8:41 PM
I want to integrate my angular app with spring boot project
 
https://github.com/angular/angular-cli#proxy-to-backend
 
here is an instruction how to do proxying to backend. I did everything step by step and only the first entry route / work .
here my proxy.conf.json file
 
{
"/token/*": {
"target": "http://localhost:8080",
"secure": false,
"logLevel": "debug",
"changeOrigin": true ,
"pathRewrite": {"^/token" : ""} ,
"headers": {
"Connection": "keep-alive"
}
}
}
 
but i got this error
 
Error: Uncaught (in promise): NullInjectorError: StaticInjectorError(to)[a]:
StaticInjectorError(Platform: core)[a]:
NullInjectorError: No provider for a!
NullInjectorError: StaticInjectorError(to)[a]:
StaticInjectorError(Platform: core)[a]:
NullInjectorError: No provider for a!
at rt.get (main-es2015.fb2e7d77856e5a1dfce3.js:1)

Answers (4)