Minor fixes
This commit is contained in:
@@ -5,5 +5,7 @@ public class AppSettings
|
|||||||
#nullable enable
|
#nullable enable
|
||||||
public Settings? Settings { get; set; }
|
public Settings? Settings { get; set; }
|
||||||
public PrivateSettings? PrivateSettings { get; set; }
|
public PrivateSettings? PrivateSettings { get; set; }
|
||||||
|
public OpenApiSettings? OpenApiSettings { get; set; }
|
||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
}
|
}
|
||||||
10
Models/Settings/OpenApiSettings.cs
Normal file
10
Models/Settings/OpenApiSettings.cs
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
namespace BasicDotnetTemplate.Models.Settings;
|
||||||
|
|
||||||
|
public class OpenApiSettings
|
||||||
|
{
|
||||||
|
#nullable enable
|
||||||
|
public string? TermsOfServiceUrl { get; set; }
|
||||||
|
public OpenApiSettingsDetails? OpenApiContact { get; set; }
|
||||||
|
public OpenApiSettingsDetails? OpenApiLicense { get; set; }
|
||||||
|
#nullable disable
|
||||||
|
}
|
||||||
9
Models/Settings/OpenApiSettingsDetails.cs
Normal file
9
Models/Settings/OpenApiSettingsDetails.cs
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
namespace BasicDotnetTemplate.Models.Settings;
|
||||||
|
|
||||||
|
public class OpenApiSettingsDetails
|
||||||
|
{
|
||||||
|
#nullable enable
|
||||||
|
public string? Name { get; set; }
|
||||||
|
public string? Url { get; set; }
|
||||||
|
#nullable disable
|
||||||
|
}
|
||||||
17
Program.cs
17
Program.cs
@@ -1,8 +1,9 @@
|
|||||||
using Microsoft.OpenApi.Models;
|
using Microsoft.OpenApi.Models;
|
||||||
|
using BasicDotnetTemplate.Controllers;
|
||||||
using BasicDotnetTemplate.Models.Settings;
|
using BasicDotnetTemplate.Models.Settings;
|
||||||
|
|
||||||
namespace BasicDotnetTemplate;
|
namespace BasicDotnetTemplate;
|
||||||
internal class Program
|
internal static class Program
|
||||||
{
|
{
|
||||||
public static void Main(string[] args)
|
public static void Main(string[] args)
|
||||||
{
|
{
|
||||||
@@ -63,10 +64,15 @@ internal class Program
|
|||||||
app.UseAuthentication();
|
app.UseAuthentication();
|
||||||
app.UseAuthorization();
|
app.UseAuthorization();
|
||||||
|
|
||||||
app.MapGet("/", () =>
|
app.UseHttpsRedirection();
|
||||||
{
|
app.UseStaticFiles();
|
||||||
return "Hello World!";
|
|
||||||
});
|
app.UseRouting();
|
||||||
|
|
||||||
|
app.MapControllerRoute(
|
||||||
|
name: "default",
|
||||||
|
pattern: "{controller=Home}/{action=Index}/{id?}"
|
||||||
|
);
|
||||||
|
|
||||||
if (app.Environment.IsDevelopment())
|
if (app.Environment.IsDevelopment())
|
||||||
{
|
{
|
||||||
@@ -76,7 +82,6 @@ internal class Program
|
|||||||
{
|
{
|
||||||
options.InjectStylesheet("/swagger-ui/custom.css");
|
options.InjectStylesheet("/swagger-ui/custom.css");
|
||||||
options.SwaggerEndpoint("/swagger/v1/swagger.json", "v1");
|
options.SwaggerEndpoint("/swagger/v1/swagger.json", "v1");
|
||||||
// options.RoutePrefix = string.Empty;
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,18 @@
|
|||||||
"Settings": {
|
"Settings": {
|
||||||
"Name": "BasicDotnetTemplate",
|
"Name": "BasicDotnetTemplate",
|
||||||
"Version": "v1.0",
|
"Version": "v1.0",
|
||||||
"Description": "This template contains basic configuration for a .Net 8 backend"
|
"Description": "This template contains basic configuration for a .Net 8 backend"
|
||||||
|
},
|
||||||
|
"OpenApiSettings": {
|
||||||
|
"TermsOfServiceUrl": "",
|
||||||
|
"OpenApiContact": {
|
||||||
|
"Name": "",
|
||||||
|
"Url": ""
|
||||||
|
},
|
||||||
|
"OpenApiLicense": {
|
||||||
|
"Name": "",
|
||||||
|
"Url": ""
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user