Changeset 463 for TFP-WebServer/WebServer/src/WebMod.cs
- Timestamp:
- Aug 17, 2023, 4:57:23 PM (15 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TFP-WebServer/WebServer/src/WebMod.cs
r434 r463 10 10 11 11 public readonly Mod ParentMod; 12 public readonly string ReactBundle; // Absolute web path to the React bundle if the mod has one, e.g. "/webmods/myMod/bundle.js" 13 public readonly string CssPath; // Absolute web path to a CSS if the mod has one, e.g. "/webmods/myMod/styling.css"; 12 /// <summary> 13 /// Absolute web path to the mod web root, e.g. "/webmods/myMod/" 14 /// </summary> 15 public readonly string ModUrl; 16 /// <summary> 17 /// Absolute web path to the React bundle if the mod has one, e.g. "/webmods/myMod/bundle.js" 18 /// </summary> 19 public readonly string ReactBundle; 20 /// <summary> 21 /// Absolute web path to a CSS if the mod has one, e.g. "/webmods/myMod/styling.css" 22 /// </summary> 23 public readonly string CssPath; 14 24 public readonly bool IsWebMod; 15 25 … … 24 34 } 25 35 26 string urlWebModBase = $"{modsBaseUrl}{_parentMod.FolderName}/";36 ModUrl = $"{modsBaseUrl}{_parentMod.Name}/"; 27 37 28 38 ReactBundle = $"{folder}/{reactBundleName}"; 29 ReactBundle = File.Exists (ReactBundle) ? $"{ urlWebModBase}{reactBundleName}" : null;39 ReactBundle = File.Exists (ReactBundle) ? $"{ModUrl}{reactBundleName}" : null; 30 40 31 41 CssPath = $"{folder}/{stylingFileName}"; 32 CssPath = File.Exists (CssPath) ? $"{ urlWebModBase}{stylingFileName}" : null;42 CssPath = File.Exists (CssPath) ? $"{ModUrl}{stylingFileName}" : null; 33 43 34 _parentWeb.RegisterPathHandler ( urlWebModBase, new StaticHandler (44 _parentWeb.RegisterPathHandler (ModUrl, new StaticHandler ( 35 45 folder, 36 46 _useStaticCache ? new SimpleCache () : new DirectAccess (),
Note:
See TracChangeset
for help on using the changeset viewer.