Skip to content

Support for UI under a path example.com/cloudify/console #1680

@aitorhh

Description

@aitorhh

I haven't found a way to use a subpath for the UI externally (without rebuilding the cloudify-stage/).

It would be great if you could include an option to set the baseUrl by, for example, reading environmental variable. For example in Vue.js: https://cli.vuejs.org/config/#publicpath, or with react https://medium.com/@svinkle/how-to-deploy-a-react-app-to-a-subdirectory-f694d46427c1. However these options will be only valid when re-building the application.

Also, in angular that is possible dynamically by using the localtion.pathname of the requests. It is something like:

export function getBaseLocation() {
    let paths: string[] = location.pathname.split('/').splice(1, 1);
    let basePath: string = (paths && !ROUTES_PATH.includes(paths[0]) && paths[0]) || ''; // Default: ''
    return '/' + basePath;
}

And declaring in the providers:

{
provide: APP_BASE_HREF,
useFactory: getBaseLocation
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions