What I want to achieve is a basic JHipster Project with the FrontEnd (in my case Angular) that is served by not the default /
but from the /something-else
.
This because I want to place some other content inside the /
.
I've seen this similar question: How to set base url for Angular application but it didn't help me.
I would like to set that behavior for all the profiles: dev/prod/etc.
I would recommend to use the Apache/Nginx to do this kind of configuration without changing jhipster context but you can do it like this:
First you need to add context-path
on you application.yml
:
server.servlet.context-path: /something-else/
Then you need to update the webpack.prod.js
or webpack.common.js
with the proper base attribute value. Considering jhipster as the context path, the base attribute value should looks like:
new HtmlWebpackPlugin({
...
base: '/something-else/'
})
See more information here
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.