Skip to content

Commit

Permalink
Add back some missing using statements, fix DEBUG only bug (#115)
Browse files Browse the repository at this point in the history
  • Loading branch information
JonathanBout authored Jan 24, 2025
1 parent 026ebbd commit 8ea2a33
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/core/Endpoints/CDNEndpoints.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using SimpleCDN.Configuration;
using SimpleCDN.Helpers;
using SimpleCDN.Services;
using SimpleCDN.Services.Caching;
using SimpleCDN.Services.Compression;

namespace SimpleCDN.Endpoints
Expand Down
2 changes: 2 additions & 0 deletions src/standalone/AdditionalEndpoints.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using SimpleCDN.Endpoints;
using SimpleCDN.Services.Caching;
using SimpleCDN.Services.Caching.Implementations;

namespace SimpleCDN.Standalone
{
Expand Down
3 changes: 3 additions & 0 deletions src/standalone/GlobalConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
* This file is basically AssemblyInfo.cs, but with the option to add global suppressions,
* or global constants.
*/
using SimpleCDN.Configuration;
using SimpleCDN.Extensions.Redis;
using System.Runtime.CompilerServices;
using System.Text.Json.Serialization;

[assembly: InternalsVisibleTo("SimpleCDN.Tests.Integration")]

Expand Down
10 changes: 9 additions & 1 deletion src/standalone/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
using Microsoft.Extensions.Options;
using SimpleCDN.Configuration;
using SimpleCDN.Extensions.Redis;
using SimpleCDN.Services.Caching;
using System.Runtime.CompilerServices;
using System.Text.Json;
using TomLonghurst.ReadableTimeSpan;

namespace SimpleCDN.Standalone
Expand All @@ -23,10 +28,13 @@ private static void Main(string[] args)
builder.Services.AddSimpleCDN()
.MapConfiguration(builder.Configuration);

#if DEBUG
builder.Services.ConfigureHttpJsonOptions(options => options.SerializerOptions.TypeInfoResolverChain.Add(ExtraSourceGenerationContext.Default));
#endif

WebApplication app = builder
.Build();
#if DEBUG
builder.Services.ConfigureHttpJsonOptions(options => options.SerializerOptions.TypeInfoResolverChain.Add(ExtraSourceGenerationContext.Default));
// useful for debugging configuration issues
if (args.Contains("--dump-config"))
{
Expand Down

0 comments on commit 8ea2a33

Please sign in to comment.