This commit is contained in:
2020-10-27 01:04:23 +01:00
parent 73210948aa
commit 690fa36cf4
2 changed files with 8 additions and 12 deletions
+4 -4
View File
@@ -7,13 +7,13 @@ namespace zero.Core.Routing
{
public abstract class AbtractRouteProvider<T> : IRouteProvider<T>
{
public virtual string Alias { get; }
public virtual string Alias { get; protected set; }
public virtual Type[] AffectedTypes { get; }
public virtual Type[] AffectedTypes { get; protected set; }
public virtual string Controller { get; }
public virtual string Controller { get; protected set; }
public virtual string Action { get; }
public virtual string Action { get; protected set; }
public const string ID_PREFIX = "routes.";
+4 -8
View File
@@ -66,12 +66,10 @@ namespace zero.Web
});
});
app.UseWhen(ctx => !ctx.Request.Path.ToString().StartsWith(path), builder =>
app.UseEndpoints(endpoints =>
{
app.UseEndpoints(endpoints =>
{
endpoints.MapDynamicControllerRoute<ZeroRoutesTransformer>("/{**url}");
});
endpoints.MapDynamicControllerRoute<ZeroRoutesTransformer>("{**url}");
});
return app;
@@ -104,14 +102,12 @@ namespace zero.Web
}
public static IApplicationBuilder UseZeroDevEnvironment(this IApplicationBuilder app, string path = null)
public static IApplicationBuilder UseZeroDevEnvironment(this IApplicationBuilder app)
{
//IZeroOptions options = app.ApplicationServices.GetService<IZeroOptions>();
//string zeroPath = options.BackofficePath.EnsureStartsWith('/').TrimEnd('/');
//app.UseDeveloperExceptionPage();
//string webUiPath = path ?? Path.Combine(Environment.CurrentDirectory, "..", "zero.Web.UI"); // TODO dynPATH
// map backoffice