Skip to content

Commit 4b5c5f9

Browse files
committed
serve frontend from .NET
1 parent 9b902d4 commit 4b5c5f9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+312
-7
lines changed

Endpoints/AdventurerEndpoints.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public static class AdventurerEndpoints
1111
{
1212
public static void MapAdventurerEndpoints(this WebApplication app)
1313
{
14-
var adventurerGroup = app.MapGroup("/adventurers");
14+
var adventurerGroup = app.MapGroup("/api/adventurers");
1515

1616
adventurerGroup.MapPost("/",
1717
async (QuestLogDbContext dbContext, ClaimsPrincipal user, CreateAdventurerDto payload) =>

Endpoints/AuthEndpoints.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public static class AuthEndpoints
1919
{
2020
public static void MapAuthEndpoints(this WebApplication app)
2121
{
22-
var authGroup = app.MapGroup("/auth");
22+
var authGroup = app.MapGroup("/api/auth");
2323

2424
authGroup.MapPost("/login",
2525
async Task<IResult> (SignInManager<User> signInManager, LoginRequest request) =>

Endpoints/CharacterClassEndpoints.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ public static class CharacterClassEndpoints
99
{
1010
public static void MapCharacterClassEndpoints(this WebApplication app)
1111
{
12-
var characterClassGroup = app.MapGroup("/character-classes");
12+
var characterClassGroup = app.MapGroup("/api/character-classes");
1313

1414
characterClassGroup.MapGet("/", async (QuestLogDbContext dbContext) =>
1515
{

Endpoints/QuestEndpoints.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public static class QuestEndpoints
1111
{
1212
public static void MapQuestEndpoints(this WebApplication app)
1313
{
14-
var questGroup = app.MapGroup("/quests");
14+
var questGroup = app.MapGroup("/api/quests");
1515

1616
questGroup.MapPost("/",
1717
async Task<IResult> (CreateQuestDto payload, QuestLogDbContext dbContext, ClaimsPrincipal user) =>

Program.cs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,13 @@
121121
});
122122

123123
var app = builder.Build();
124-
app.UseCors("Frontend");
124+
app.UseHttpsRedirection();
125+
126+
app.UseDefaultFiles();
127+
app.UseStaticFiles();
128+
129+
// app.UseCors("Frontend");
130+
125131
// Configure the HTTP request pipeline.
126132
if (app.Environment.IsDevelopment())
127133
{
@@ -130,8 +136,6 @@
130136
app.MapScalarApiReference();
131137
}
132138

133-
app.UseHttpsRedirection();
134-
135139
app.UseAuthentication();
136140
app.UseAuthorization();
137141

@@ -140,4 +144,6 @@
140144
app.MapAdventurerEndpoints();
141145
app.MapQuestEndpoints();
142146

147+
// Hand a route request to React if .NET doesn't find a matching API endpoint
148+
app.MapFallbackToFile("index.html");
143149
app.Run();

wwwroot/assets/AtSign-C5idZA0X.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

wwwroot/assets/Button-BZlZGBbg.css

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

wwwroot/assets/Button-DjVsqX09.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

wwwroot/assets/CheckCircle-dwEPAdtQ.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

wwwroot/assets/FormInputField-B33G3mA_.css

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)