Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cap DashBoard use of Path_Base #901

Closed
albertopm19 opened this issue Jun 7, 2021 · 3 comments
Closed

Cap DashBoard use of Path_Base #901

albertopm19 opened this issue Jun 7, 2021 · 3 comments

Comments

@albertopm19
Copy link
Contributor

Thanks for your great work giving community this great framework!!!!!

Only some minor problems: Cap.Dashboard doesn't work well with Path_Base.

In the real world services are behind proxies with a basepath. (ej: www.domain.com/wsCap/cap.....)

I have added suport for path_base with

Add property to public class DashboardOptions

    public string PathBase { get; set; }

In UIMiddleware.cs replace
htmlBuilder.Replace("%(servicePrefix)", _options.PathMatch + "/api");
with
htmlBuilder.Replace("%(servicePrefix)", _options.PathBase+ _options.PathMatch + "/api");

With this changes in my service in startup, i can now write:

x.UseDashboard(opt => {
opt.PathMatch = "/cap";
opt.PathBase = Configuration["PATH_BASE"];
});

and it works !!!!

@yang-xiaodong
Copy link
Member

Hello, thank you for your feedback, I want to know if this configuration works in your case?

x.UseDashboard(opt => {
    opt.PathMatch = Configuration["PATH_BASE"]+ "/cap";   //  eg: /wsCap/cap
});

@albertopm19
Copy link
Contributor Author

albertopm19 commented Jun 7, 2021

No , this was the first that I tried but doesn't works....

I put an example:

in startup we have:

 var pathBase = Configuration["PATH_BASE"];
        if (!string.IsNullOrEmpty(pathBase))
        {
            app.UsePathBase(pathBase);
        }

if Path_Base = "/wsCap"

and opt.PathMatch = Configuration["PATH_BASE"]+ "/cap";

then the pages of my service are in

www.mydomain.com/wsCap/wsCap/cap/Index.html

and the api calls are www.mydomain.com/wsCap/cap/api

Thanks!!!

@yang-xiaodong
Copy link
Member

Fixed in 5.1.1-preview-140603701

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants