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

Add a configurable base path #112

Closed
ckocyigit opened this issue Sep 14, 2023 · 0 comments · Fixed by #124
Closed

Add a configurable base path #112

ckocyigit opened this issue Sep 14, 2023 · 0 comments · Fixed by #124
Assignees

Comments

@ckocyigit
Copy link
Contributor

ckocyigit commented Sep 14, 2023

Hello,

it would be nice to be able to run the whole application under a base path.

E.g.: localhost:5000/app

I've tried:

var appPath = Environment.GetEnvironmentVariable("BASE_PATH");
if (!string.IsNullOrEmpty(appPath))
{
    app.Use(async (context, next) =>
    {
        context.Request.PathBase = new PathString(appPath);
        await next();
    });
}

And

var basePath = Environment.GetEnvironmentVariable("BASE_PATH");
if (!string.IsNullOrEmpty(basePath))
{
    app.UsePathBase(basePath);
}

Within Program.cs.
But both attemps unfortuntely were unsuccessful

UsePathBase however worked for the login-screen and started trying to redirect to non-UsePathBase patterns afterwards.

sebagomez added a commit that referenced this issue Oct 20, 2023
Fork me on Github was broken

Closes #112

Signed-off-by: Sebastián Gómez <sebastiangomezcorrea@gmail.com>
@sebagomez sebagomez self-assigned this Oct 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants