hertzbeat icon indicating copy to clipboard operation
hertzbeat copied to clipboard

[Task] <support config the custom system context path>

Open tomsun28 opened this issue 2 years ago โ€ข 7 comments

Description

from https://gitee.com/dromara/hertzbeat/issues/I8EG8X

eg: contextpath is hertzbeat , access url is http://localhost:1157/hertzbeat/

Task List

  • [ ] support config the custom system context path

tomsun28 avatar Nov 07 '23 06:11 tomsun28

/assigned to me. ?/

misselvexu avatar Nov 07 '23 06:11 misselvexu

/assigned to me. ?/

ok welcome๐Ÿ‘๐Ÿ‘

tomsun28 avatar Nov 07 '23 06:11 tomsun28

hi @tomsun28 , according to the requirements of the proposal, want to be able to customize the access context path, the project involves the access path of places such as manager-web, push-api and so on, whether it is possible to use a global configuration, such as: system environment variables, run startup parameters specified in the way ?

misselvexu avatar Nov 10 '23 03:11 misselvexu

hi @tomsun28 , according to the requirements of the proposal, want to be able to customize the access context path, the project involves the access path of places such as manager-web, push-api and so on, whether it is possible to use a global configuration, such as: system environment variables, run startup parameters specified in the way ?

๐Ÿ‘hi of course. By the way, our project is separated from the front and back ends, but when packaging, we will put the static resource dist of webapp and the backend manager into one container to run.

tomsun28 avatar Nov 10 '23 04:11 tomsun28

@tomsun28 Bro, sorry for taking some time to think about the exact way to do this. Idea 1: Static resources in the runtime state can not change the root path of the route of a specific request, my idea is to compile and package the front-end project through the maven plugin of manager-web to compile and combine the front-end project together, does not support the runtime state adjustment. Idea 2 (not recommended): In the runtime state, get the configuration of the backend dynamically, combined with angular interceptor mechanism to intercept & change.

We can discuss it .

misselvexu avatar Nov 15 '23 06:11 misselvexu

hi bro, thanks for taking the time to think about this.๐Ÿ’— For idea 1, the users maybe not know how to complie and build code, most of them use the release package. Recommend to change it at runtime through configuration if possible.

I mistakenly thought it was simple. The root path / of the static resource index.html is a trouble. Change this will cause many resource paths to not be found. For idea 2, it's a solution if it works in theory, but it will take up a lot of your time?

tomsun28 avatar Nov 15 '23 09:11 tomsun28

hi bro, thanks for taking the time to think about this.๐Ÿ’— For idea 1, the users maybe not know how to complie and build code, most of them use the release package. Recommend to change it at runtime through configuration if possible.

I mistakenly thought it was simple. The root path / of the static resource index.html is a trouble. Change this will cause many resource paths to not be found. For idea 2, it's a solution if it works in theory, but it will take up a lot of your time?

The second idea is workable, give me some time, I'll submit a PR and then you help review it, thanks ~

misselvexu avatar Nov 16 '23 01:11 misselvexu