Backend: - Expose GET /config/playback so the frontend can detect whether anonymous listening is enabled without requiring auth - Wire anonymous access through track streaming and YouTube resolve flows Frontend: - Allow browsing/listening without a session when the backend enables it - Redesign Inicio, Sidebar and top bar with a new dark theme, typography, and layout (top bar with live quick-search, sticky/blurred on scroll) - Populate Top música, Popular and Recomendados with real Musify + YouTube Music data instead of placeholders - Various shape, spacing, color and animation refinements across the redesigned components
52 lines
1.3 KiB
C#
52 lines
1.3 KiB
C#
using System.Text.Json.Serialization;
|
|
using Musify.Infrastructure.Observability;
|
|
using Scalar.AspNetCore;
|
|
using Musify.Api.Endpoints;
|
|
using Musify.Api.Extensions;
|
|
|
|
var builder = WebApplication.CreateBuilder();
|
|
|
|
builder.Services.ConfigureHttpJsonOptions(options =>
|
|
options.SerializerOptions.Converters.Add(new JsonStringEnumConverter()));
|
|
|
|
const string devCorsPolicy = "dev-cors";
|
|
|
|
builder.Services
|
|
.AddApplicationServices(builder.Configuration)
|
|
.AddObservability(builder.Configuration);
|
|
|
|
builder.Services.AddProblemDetails();
|
|
|
|
if (builder.Environment.IsDevelopment())
|
|
{
|
|
builder.Services.AddCors(options => options.AddPolicy(devCorsPolicy, policy =>
|
|
policy.AllowAnyOrigin().AllowAnyHeader().AllowAnyMethod()));
|
|
}
|
|
|
|
var app = builder.Build();
|
|
|
|
app.UseExceptionHandler();
|
|
|
|
if (app.Environment.IsDevelopment())
|
|
{
|
|
app.UseCors(devCorsPolicy);
|
|
app.MapOpenApi();
|
|
app.MapScalarApiReference();
|
|
}
|
|
|
|
app.UseAuthentication();
|
|
app.UseAuthorization();
|
|
|
|
app
|
|
.MapAlbumEndpoints()
|
|
.MapConfigEndpoints()
|
|
.MapMixEndpoints()
|
|
.MapPlayListEndpoints()
|
|
.MapTrackEndpoints()
|
|
.MapUserEndpoints();
|
|
|
|
app.Run();
|
|
|
|
// Makes the top-level-statements Program class public so
|
|
// WebApplicationFactory<Program> (Musify.Api.Tests) can see it.
|
|
public partial class Program; |