Skip to content
Permalink
Browse files

Move SVG to static asset

  • Loading branch information...
mythz committed Aug 10, 2019
1 parent 14961da commit b61f01ea5f97901213b409f79a087d5e698f7d25
@@ -18,8 +18,7 @@ public class FallbackForClientRoutes
public class MyServices : Service
{
//Return index.html for unmatched requests so routing is handled on client
public object Any(FallbackForClientRoutes request) =>
Request.GetPageResult("/");
public object Any(FallbackForClientRoutes request) => Request.GetPageResult("/");

public object Any(Hello request)
{
@@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using ServiceStack;

namespace MyApp
{
public class ConfigureUi : IConfigureAppHost
{
public void Configure(IAppHost appHost)
{
// if wwwroot/ is empty, build Client App with 'npm run build'
var svgDir = appHost.RootDirectory.GetDirectory("/svg") ?? appHost.ContentRootDirectory.GetDirectory("/public/svg");
if (svgDir != null)
{
Svg.Load(svgDir);
}
Svg.CssFillColor["svg-icons"] = "#2f495e";
}
}
}

@@ -9,12 +9,6 @@
<ItemGroup>
<Folder Include="wwwroot\" />
</ItemGroup>

<ItemGroup>
<Content Include="src\assets\svg\**">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.App" />
@@ -57,9 +57,6 @@ public override void Configure(Container container)
AddRedirectParamsToQueryString = true,
DebugMode = AppSettings.Get(nameof(HostConfig.DebugMode), HostingEnvironment.IsDevelopment()),
});

Svg.Load(ContentRootDirectory.GetDirectory("/src/assets/svg"));
Svg.CssFillColor["svg-icons"] = "#2f495e";
}
}
}
File renamed without changes.
File renamed without changes.

0 comments on commit b61f01e

Please sign in to comment.
You can’t perform that action at this time.