Skip to content

Commit 365c9a2

Browse files
committed
Rename sample-app folder
1 parent 6bb15f2 commit 365c9a2

18 files changed

+553
-553
lines changed

sample-app/DotNetSampleApp.csproj renamed to DotNetSampleApp/DotNetSampleApp.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0" />
1414
</ItemGroup>
1515

16-
<!-- <ItemGroup>-->
17-
<!-- <ProjectReference Include="../fauna-dotnet/Fauna/Fauna.csproj" />-->
18-
<!-- </ItemGroup>-->
16+
<!-- <ItemGroup>-->
17+
<!-- <ProjectReference Include="../fauna-dotnet/Fauna/Fauna.csproj" />-->
18+
<!-- </ItemGroup>-->
1919

2020
</Project>
File renamed without changes.
File renamed without changes.
File renamed without changes.
Lines changed: 65 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,65 @@
1-
using System.Reflection;
2-
using DotNetSampleApp.Middlewares;
3-
using DotNetSampleApp.Services;
4-
using Fauna;
5-
using Microsoft.AspNetCore.Mvc;
6-
using Microsoft.OpenApi.Models;
7-
8-
var builder = WebApplication.CreateBuilder(args);
9-
builder.Services.AddEndpointsApiExplorer();
10-
builder.Services.AddSwaggerGen();
11-
builder.Services.AddRouting(options => options.LowercaseUrls = true);
12-
builder.Services.AddControllers(options =>
13-
{
14-
options.Filters.Add(new ProducesAttribute("application/json"));
15-
options.Filters.Add(new ConsumesAttribute("application/json"));
16-
});
17-
18-
builder.Services.AddSingleton<Client>(_ =>
19-
{
20-
var secret = Environment.GetEnvironmentVariable("FAUNA_SECRET");
21-
if (string.IsNullOrEmpty(secret))
22-
{
23-
throw new InvalidOperationException("Required environment variable not set: FAUNA_SECRET");
24-
}
25-
26-
var client = new Client(secret);
27-
SeedService.Init(client);
28-
29-
return client;
30-
});
31-
builder.Services.AddSwaggerGen(options =>
32-
{
33-
options.SwaggerDoc("v1", new OpenApiInfo
34-
{
35-
Version = "v1",
36-
Title = "Fauna dotnet Sample App",
37-
Description = "A mock shopping API",
38-
Contact = new OpenApiContact
39-
{
40-
Name = "Fauna Support",
41-
Url = new Uri("https://fauna.com/contact-us")
42-
},
43-
License = new OpenApiLicense
44-
{
45-
Name = "MPL 2.0"
46-
}
47-
});
48-
49-
var xmlFilename = $"{Assembly.GetExecutingAssembly().GetName().Name}.xml";
50-
options.IncludeXmlComments(Path.Combine(AppContext.BaseDirectory, xmlFilename));
51-
});
52-
53-
var app = builder.Build();
54-
55-
if (app.Environment.IsDevelopment())
56-
{
57-
app.UseSwagger();
58-
app.UseSwaggerUI();
59-
}
60-
61-
app.UseMiddleware<ExceptionHandlingMiddleware>();
62-
app.MapControllers();
63-
64-
65-
app.Run();
1+
using System.Reflection;
2+
using DotNetSampleApp.Middlewares;
3+
using DotNetSampleApp.Services;
4+
using Fauna;
5+
using Microsoft.AspNetCore.Mvc;
6+
using Microsoft.OpenApi.Models;
7+
8+
var builder = WebApplication.CreateBuilder(args);
9+
builder.Services.AddEndpointsApiExplorer();
10+
builder.Services.AddSwaggerGen();
11+
builder.Services.AddRouting(options => options.LowercaseUrls = true);
12+
builder.Services.AddControllers(options =>
13+
{
14+
options.Filters.Add(new ProducesAttribute("application/json"));
15+
options.Filters.Add(new ConsumesAttribute("application/json"));
16+
});
17+
18+
builder.Services.AddSingleton<Client>(_ =>
19+
{
20+
var secret = Environment.GetEnvironmentVariable("FAUNA_SECRET");
21+
if (string.IsNullOrEmpty(secret))
22+
{
23+
throw new InvalidOperationException("Required environment variable not set: FAUNA_SECRET");
24+
}
25+
26+
var client = new Client(secret);
27+
SeedService.Init(client);
28+
29+
return client;
30+
});
31+
builder.Services.AddSwaggerGen(options =>
32+
{
33+
options.SwaggerDoc("v1", new OpenApiInfo
34+
{
35+
Version = "v1",
36+
Title = "Fauna dotnet Sample App",
37+
Description = "A mock shopping API",
38+
Contact = new OpenApiContact
39+
{
40+
Name = "Fauna Support",
41+
Url = new Uri("https://fauna.com/contact-us")
42+
},
43+
License = new OpenApiLicense
44+
{
45+
Name = "MPL 2.0"
46+
}
47+
});
48+
49+
var xmlFilename = $"{Assembly.GetExecutingAssembly().GetName().Name}.xml";
50+
options.IncludeXmlComments(Path.Combine(AppContext.BaseDirectory, xmlFilename));
51+
});
52+
53+
var app = builder.Build();
54+
55+
if (app.Environment.IsDevelopment())
56+
{
57+
app.UseSwagger();
58+
app.UseSwaggerUI();
59+
}
60+
61+
app.UseMiddleware<ExceptionHandlingMiddleware>();
62+
app.MapControllers();
63+
64+
65+
app.Run();
Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,41 @@
1-
{
2-
"$schema": "http://json.schemastore.org/launchsettings.json",
3-
"iisSettings": {
4-
"windowsAuthentication": false,
5-
"anonymousAuthentication": true,
6-
"iisExpress": {
7-
"applicationUrl": "http://localhost:10719",
8-
"sslPort": 44302
9-
}
10-
},
11-
"profiles": {
12-
"http": {
13-
"commandName": "Project",
14-
"dotnetRunMessages": true,
15-
"launchBrowser": true,
16-
"launchUrl": "swagger",
17-
"applicationUrl": "http://localhost:5049",
18-
"environmentVariables": {
19-
"ASPNETCORE_ENVIRONMENT": "Development"
20-
}
21-
},
22-
"https": {
23-
"commandName": "Project",
24-
"dotnetRunMessages": true,
25-
"launchBrowser": true,
26-
"launchUrl": "swagger",
27-
"applicationUrl": "https://localhost:7257;http://localhost:5049",
28-
"environmentVariables": {
29-
"ASPNETCORE_ENVIRONMENT": "Development"
30-
}
31-
},
32-
"IIS Express": {
33-
"commandName": "IISExpress",
34-
"launchBrowser": true,
35-
"launchUrl": "swagger",
36-
"environmentVariables": {
37-
"ASPNETCORE_ENVIRONMENT": "Development"
38-
}
39-
}
40-
}
41-
}
1+
{
2+
"$schema": "http://json.schemastore.org/launchsettings.json",
3+
"iisSettings": {
4+
"windowsAuthentication": false,
5+
"anonymousAuthentication": true,
6+
"iisExpress": {
7+
"applicationUrl": "http://localhost:10719",
8+
"sslPort": 44302
9+
}
10+
},
11+
"profiles": {
12+
"http": {
13+
"commandName": "Project",
14+
"dotnetRunMessages": true,
15+
"launchBrowser": true,
16+
"launchUrl": "swagger",
17+
"applicationUrl": "http://localhost:5049",
18+
"environmentVariables": {
19+
"ASPNETCORE_ENVIRONMENT": "Development"
20+
}
21+
},
22+
"https": {
23+
"commandName": "Project",
24+
"dotnetRunMessages": true,
25+
"launchBrowser": true,
26+
"launchUrl": "swagger",
27+
"applicationUrl": "https://localhost:7257;http://localhost:5049",
28+
"environmentVariables": {
29+
"ASPNETCORE_ENVIRONMENT": "Development"
30+
}
31+
},
32+
"IIS Express": {
33+
"commandName": "IISExpress",
34+
"launchBrowser": true,
35+
"launchUrl": "swagger",
36+
"environmentVariables": {
37+
"ASPNETCORE_ENVIRONMENT": "Development"
38+
}
39+
}
40+
}
41+
}
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
{
2-
"Logging": {
3-
"LogLevel": {
4-
"Default": "Information",
5-
"Microsoft.AspNetCore": "Warning"
6-
}
7-
}
8-
}
1+
{
2+
"Logging": {
3+
"LogLevel": {
4+
"Default": "Information",
5+
"Microsoft.AspNetCore": "Warning"
6+
}
7+
}
8+
}
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
{
2-
"Logging": {
3-
"LogLevel": {
4-
"Default": "Information",
5-
"Microsoft.AspNetCore": "Warning"
6-
}
7-
},
8-
"AllowedHosts": "*"
9-
}
1+
{
2+
"Logging": {
3+
"LogLevel": {
4+
"Default": "Information",
5+
"Microsoft.AspNetCore": "Warning"
6+
}
7+
},
8+
"AllowedHosts": "*"
9+
}

0 commit comments

Comments
 (0)