Reputation: 1222
I have changed context path in my jHipster application, as documented by spring boot docs (prop: server.servlet.context-path: /mypath). However this made the jHipster generated UI unable to make API calls. So i tried to update app/app.constants.ts:
SERVER_API_URL = process.env.SERVER_API_URL + '/mypath';
but that made no difference. Any ideas?
Upvotes: 2
Views: 2143
Reputation: 1222
Ok i found the solution. When you update context-path and you are using
yarn start
(to serve UI + proxy api calls), you also have to update webpack.dev.js -> context. Example:
context: [ '/api', '/auth'.....]
to something like this:
context: [ '/myContextPath/api', '/myContextPath/auth'.....]
Also do not forget to include the context path in app/app.constants.ts as described in the question.
SERVER_API_URL = process.env.SERVER_API_URL + '/mypath';
Upvotes: 3