Skip to content

Commit 79c9b35

Browse files
Web/API cleanup
1 parent eaf9927 commit 79c9b35

File tree

7 files changed

+26
-37
lines changed

7 files changed

+26
-37
lines changed

API/OCM.Net/OCM.API.Web/OCM.API.Web.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
<UserSecretsId>407b1e1a-5108-48b6-bb48-4990a0804269</UserSecretsId>
66
</PropertyGroup>
77
<ItemGroup>
8-
<PackageReference Include="Ben.BlockingDetector" Version="0.0.4" />
98
<PackageReference Include="Microsoft.AspNetCore.Http.Extensions" Version="2.3.0" />
109
<PackageReference Include="Microsoft.IdentityModel.JsonWebTokens" Version="8.14.0" />
1110
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="8.14.0" />

API/OCM.Net/OCM.API.Web/Startup.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using Ben.Diagnostics;
21
using Microsoft.AspNetCore.Builder;
32
using Microsoft.AspNetCore.Hosting;
43
using Microsoft.Extensions.Configuration;
@@ -48,10 +47,6 @@ public void ConfigureServices(IServiceCollection services)
4847
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
4948
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
5049
{
51-
#if DEBUG
52-
app.UseBlockingDetection();
53-
#endif
54-
5550
if (env.IsDevelopment())
5651
{
5752
app.UseDeveloperExceptionPage();

API/OCM.Net/OCM.API.Web/web.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<handlers>
66
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
77
</handlers>
8-
<aspNetCore processPath="dotnet" arguments="OCM.API.Web.dll" stdoutLogEnabled="true" hostingModel="inprocess">
8+
<aspNetCore processPath="dotnet" arguments="OCM.API.Web.dll" stdoutLogEnabled="false" hostingModel="inprocess">
99
</aspNetCore>
1010
<httpCompression>
1111
<dynamicTypes>

Website/OCM.Web/OCM.Web.csproj

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,10 @@
1919

2020

2121
<ItemGroup>
22-
<PackageReference Include="Ben.BlockingDetector" Version="0.0.4" />
22+
2323
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="9.0.8" />
2424
<PackageReference Include="Microsoft.Extensions.Caching.SqlServer" Version="9.0.8" />
25-
<PackageReference Include="Microsoft.TypeScript.MSBuild" Version="5.9.2">
26-
<PrivateAssets>all</PrivateAssets>
27-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
28-
</PackageReference>
29-
<PackageReference Include="Microsoft.VisualStudio.SlowCheetah" Version="4.0.50">
30-
<PrivateAssets>all</PrivateAssets>
31-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
32-
</PackageReference>
25+
3326
</ItemGroup>
3427

3528
<ItemGroup>

Website/OCM.Web/Startup.cs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using Ben.Diagnostics;
21
using Microsoft.AspNetCore.Authorization;
32
using Microsoft.AspNetCore.Builder;
43
using Microsoft.AspNetCore.DataProtection;
@@ -22,7 +21,14 @@ public Startup(IConfiguration configuration)
2221
var settings = new Core.Settings.CoreSettings();
2322
configuration.GetSection("CoreSettings").Bind(settings);
2423

25-
Core.Data.CacheProviderMongoDB.CreateDefaultInstance(settings);
24+
try
25+
{
26+
Core.Data.CacheProviderMongoDB.CreateDefaultInstance(settings);
27+
}
28+
catch (Exception ex)
29+
{
30+
System.Diagnostics.Debug.WriteLine("Failed to connect to MongoDB for caching: " + ex.Message);
31+
}
2632
}
2733

2834
public IConfiguration Configuration { get; }
@@ -88,10 +94,6 @@ public void ConfigureServices(IServiceCollection services)
8894
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
8995
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
9096
{
91-
#if DEBUG
92-
app.UseBlockingDetection();
93-
#endif
94-
9597
app.UseSession();
9698

9799
app.UseStatusCodePagesWithRedirects("~/Home/Error?code={0}");

Website/OCM.Web/Views/About/DataSharing.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
}
1616

1717
<div class="container">
18-
<h1>Share Network Data with Open Charge Map</h1>
18+
<h1>Promote Your Network Locations with Open Charge Map</h1>
1919
<div class="alert alert-info">
2020
<p>
2121
We invite all charging networks to promote their charging locations for free via <em>Open Charge Map</em> by directly supplying EVSE charging station location information to us as an OCPI data feed for import and redistribution.

Website/OCM.Web/web.config

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<configuration>
3-
<location path="." inheritInChildApplications="false">
4-
<system.webServer>
5-
<handlers>
6-
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
7-
</handlers>
8-
<aspNetCore processPath="dotnet" arguments=".\OCM.Web.dll" stdoutLogEnabled="true" hostingModel="inprocess">
3+
<location path="." inheritInChildApplications="false">
4+
<system.webServer>
5+
<handlers>
6+
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
7+
</handlers>
8+
<aspNetCore processPath="dotnet" arguments=".\OCM.Web.dll" stdoutLogEnabled="false" hostingModel="inprocess">
99

10-
</aspNetCore>
11-
<httpCompression>
12-
<dynamicTypes>
13-
<add mimeType="application/json" enabled="true" />
14-
</dynamicTypes>
15-
</httpCompression>
16-
</system.webServer>
17-
</location>
10+
</aspNetCore>
11+
<httpCompression>
12+
<dynamicTypes>
13+
<add mimeType="application/json" enabled="true" />
14+
</dynamicTypes>
15+
</httpCompression>
16+
</system.webServer>
17+
</location>
1818
</configuration>

0 commit comments

Comments
 (0)