Changeset 402 for binary-improvements2/WebServer/src/WebMod.cs
- Timestamp:
- Jan 27, 2023, 7:28:00 PM (22 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements2/WebServer/src/WebMod.cs
r391 r402 1 1 using System.IO; 2 using AllocsFixes.FileCache;2 using Webserver.FileCache; 3 3 using Webserver.UrlHandlers; 4 4 … … 14 14 15 15 public WebMod (Web _parentWeb, Mod _parentMod, bool _useStaticCache) { 16 string folder = _parentMod.Path + "/WebMod";16 string folder = $"{_parentMod.Path}/WebMod"; 17 17 if (!Directory.Exists (folder)) { 18 18 throw new InvalidDataException("No WebMod folder in mod"); … … 21 21 string urlWebModBase = $"{modsBaseUrl}{_parentMod.FolderName}/"; 22 22 23 ReactBundle = folder + "/" + reactBundleName; 24 if (File.Exists (ReactBundle)) { 25 ReactBundle = urlWebModBase + reactBundleName; 26 } else { 27 ReactBundle = null; 28 } 23 ReactBundle = $"{folder}/{reactBundleName}"; 24 ReactBundle = File.Exists (ReactBundle) ? $"{urlWebModBase}{reactBundleName}" : null; 29 25 30 CssPath = folder + "/" + stylingFileName; 31 if (File.Exists (CssPath)) { 32 CssPath = urlWebModBase + stylingFileName; 33 } else { 34 CssPath = null; 35 } 26 CssPath = $"{folder}/{stylingFileName}"; 27 CssPath = File.Exists (CssPath) ? $"{urlWebModBase}{stylingFileName}" : null; 36 28 37 29 if (ReactBundle == null && CssPath == null) { … … 43 35 _parentWeb.RegisterPathHandler (urlWebModBase, new StaticHandler ( 44 36 folder, 45 _useStaticCache ? (AbstractCache)new SimpleCache () : new DirectAccess (),37 _useStaticCache ? new SimpleCache () : new DirectAccess (), 46 38 false) 47 39 );
Note:
See TracChangeset
for help on using the changeset viewer.