Ignore:
Timestamp:
Aug 17, 2023, 4:57:23 PM (15 months ago)
Author:
alloc
Message:

21.1.16.0 release
Completed OpenAPI specs
Add support to path handlers to register OpenAPI specs
Fixed ItemIconHandler throwing error when requested path contains no dot

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TFP-WebServer/WebServer/src/WebMod.cs

    r434 r463  
    1010               
    1111                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;
    1424                public readonly bool IsWebMod;
    1525
     
    2434                        }
    2535
    26                         string urlWebModBase = $"{modsBaseUrl}{_parentMod.FolderName}/";
     36                        ModUrl = $"{modsBaseUrl}{_parentMod.Name}/";
    2737
    2838                        ReactBundle = $"{folder}/{reactBundleName}";
    29                         ReactBundle = File.Exists (ReactBundle) ? $"{urlWebModBase}{reactBundleName}" : null;
     39                        ReactBundle = File.Exists (ReactBundle) ? $"{ModUrl}{reactBundleName}" : null;
    3040
    3141                        CssPath = $"{folder}/{stylingFileName}";
    32                         CssPath = File.Exists (CssPath) ? $"{urlWebModBase}{stylingFileName}" : null;
     42                        CssPath = File.Exists (CssPath) ? $"{ModUrl}{stylingFileName}" : null;
    3343
    34                         _parentWeb.RegisterPathHandler (urlWebModBase, new StaticHandler (
     44                        _parentWeb.RegisterPathHandler (ModUrl, new StaticHandler (
    3545                                folder,
    3646                                _useStaticCache ? new SimpleCache () : new DirectAccess (),
Note: See TracChangeset for help on using the changeset viewer.