1
0
mirror of synced 2024-11-23 22:41:01 +01:00

Prepare for release

This commit is contained in:
asesidaa 2022-09-10 01:27:20 +08:00
parent 75c98591d8
commit 7d3cb81c19
6 changed files with 18 additions and 8 deletions

View File

@ -64,13 +64,18 @@ app.UseForwardedHeaders(new ForwardedHeadersOptions
ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto
});
// For blazor hosting
app.UseBlazorFrameworkFiles();
app.UseStaticFiles();
app.UseRouting();
app.UseHttpLogging();
app.MapControllers();
app.MapFallbackToFile("index.html");
app.UseCors("DevCorsPolicy");
app.UseWhen(context => context.Request.Path.StartsWithSegments("/sys/servlet/PowerOn", StringComparison.InvariantCulture),
applicationBuilder => applicationBuilder.UseAllNetRequestMiddleware());
app.MapGet("/", () => "Hello world");
app.Run();

View File

@ -11,6 +11,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="6.0.7" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.0-preview.7.22376.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="7.0.0-preview.7.22376.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="7.0.0-preview.7.22376.2">
@ -44,6 +45,7 @@
<ItemGroup>
<ProjectReference Include="..\SharedProject\SharedProject.csproj" />
<ProjectReference Include="..\TaikoWebUI\TaikoWebUI.csproj"/>
</ItemGroup>
</Project>

View File

@ -1,2 +1 @@
wwwroot/data/musicinfo
wwwroot/data/wordlist
wwwroot/data/*

View File

@ -18,6 +18,10 @@ builder.Services.AddSingleton<IGameDataService, GameDataService>();
var host = builder.Build();
var gameDataService = host.Services.GetRequiredService<IGameDataService>();
#if DEBUG
await gameDataService.InitializeAsync(builder.Configuration.GetValue<string>("DataBaseUrl"));
#else
await gameDataService.InitializeAsync(builder.Configuration.GetValue<string>("BaseUrl"));
#endif
await host.RunAsync();

View File

@ -20,8 +20,8 @@ public class GameDataService : IGameDataService
public async Task InitializeAsync(string dataBaseUrl)
{
var musicInfo = await client.GetFromJsonAsync<MusicInfo>($"{dataBaseUrl}/data/musicinfo");
var wordList = await client.GetFromJsonAsync<WordList>($"{dataBaseUrl}/data/wordlist");
var musicInfo = await client.GetFromJsonAsync<MusicInfo>($"{dataBaseUrl}/data/musicinfo.json");
var wordList = await client.GetFromJsonAsync<WordList>($"{dataBaseUrl}/data/wordlist.json");
musicInfo.ThrowIfNull();
wordList.ThrowIfNull();

View File

@ -20,10 +20,10 @@
<Content Update="wwwroot\appsettings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Update="wwwroot\data\musicinfo">
<Content Update="wwwroot\data\musicinfo.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Update="wwwroot\data\wordlist">
<Content Update="wwwroot\data\wordlist.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>