diff options
| author | Paweł Bernaciak <pawelbernaciak@zohomail.eu> | 2023-02-10 16:19:46 +0100 |
|---|---|---|
| committer | Paweł Bernaciak <pawelbernaciak@zohomail.eu> | 2023-02-10 16:19:46 +0100 |
| commit | 00c3b32e2db200a2f42396ac7f8381704ec97268 (patch) | |
| tree | 089d68dcbda127d4c95ccca9b0c9a18b59dc8bdc /CoreWiki/BuilderExtensions.cs | |
Initial Commit
Diffstat (limited to 'CoreWiki/BuilderExtensions.cs')
| -rw-r--r-- | CoreWiki/BuilderExtensions.cs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/CoreWiki/BuilderExtensions.cs b/CoreWiki/BuilderExtensions.cs new file mode 100644 index 0000000..f68deca --- /dev/null +++ b/CoreWiki/BuilderExtensions.cs @@ -0,0 +1,16 @@ +using Microsoft.Extensions.FileProviders; + +namespace CoreWiki; + +public static class BuilderExtensions +{ + public static void ServeNodePackage(this IApplicationBuilder app, IHostEnvironment env, string packageName) + { + app.UseStaticFiles(new StaticFileOptions() + { + FileProvider = new PhysicalFileProvider( + Path.Combine(env.ContentRootPath, "node_modules/", packageName, "dist")), + RequestPath = "/lib/" + packageName + }); + } +}
\ No newline at end of file |
