Skip to content

Instantly share code, notes, and snippets.

@tocalai
Created July 31, 2019 07:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tocalai/dc86bc4fcf3b3c901519efebb18c4606 to your computer and use it in GitHub Desktop.
Save tocalai/dc86bc4fcf3b3c901519efebb18c4606 to your computer and use it in GitHub Desktop.
Demo how to use prefix using path base
public void Configure (IApplicationBuilder app, IHostingEnvironment env)
{
// [HMR] http://www.c-sharpcorner.com/article/using-hot-module-replacement-feature-of-webpack-in-asp-net-core/
if (env.IsDevelopment ())
{
// ...
}
else
{
app.UseExceptionHandler ("/Home/Error");
}
// set base path just like concept of virtual directory
app.UsePathBase($"/{Configuration.Get<ConfigModel>().APIBaseInfo.BasePath}"));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment