From f7b0b7fb59b9cd37d34e724b85ae7ec0a0167a4f Mon Sep 17 00:00:00 2001 From: EugeneTes Date: Sat, 15 Aug 2026 11:26:23 +0000 Subject: [PATCH] Scaffold ASP.NET Core Web API backend --- backend/Program.cs | 21 ++++++++++++++++++++ backend/Properties/launchSettings.json | 13 ++++++++++++ backend/appsettings.Development.example.json | 13 ++++++++++++ backend/appsettings.json | 6 ++++++ backend/backend.csproj | 13 ++++++++++++ backend/backend.http | 6 ++++++ 6 files changed, 72 insertions(+) create mode 100644 backend/Program.cs create mode 100644 backend/Properties/launchSettings.json create mode 100644 backend/appsettings.Development.example.json create mode 100644 backend/appsettings.json create mode 100644 backend/backend.csproj create mode 100644 backend/backend.http diff --git a/backend/Program.cs b/backend/Program.cs new file mode 100644 index 0000000..35c8ff9 --- /dev/null +++ b/backend/Program.cs @@ -0,0 +1,21 @@ +var builder = WebApplication.CreateBuilder(args); + +// Add services to the container. + +builder.Services.AddControllers(); +// Learn more about configuring OpenAPI at https://aka.ms/aspnet/openapi +builder.Services.AddOpenApi(); + +var app = builder.Build(); + +// Configure the HTTP request pipeline. +if (app.Environment.IsDevelopment()) +{ + app.MapOpenApi(); +} + +app.UseAuthorization(); + +app.MapControllers(); + +app.Run(); diff --git a/backend/Properties/launchSettings.json b/backend/Properties/launchSettings.json new file mode 100644 index 0000000..425bfa2 --- /dev/null +++ b/backend/Properties/launchSettings.json @@ -0,0 +1,13 @@ +{ + "$schema": "https://json.schemastore.org/launchsettings.json", + "profiles": { + "backend": { + "commandName": "Project", + "launchBrowser": false, + "applicationUrl": "http://localhost:5000", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git a/backend/appsettings.Development.example.json b/backend/appsettings.Development.example.json new file mode 100644 index 0000000..48247da --- /dev/null +++ b/backend/appsettings.Development.example.json @@ -0,0 +1,13 @@ +{ + "Logging": { + "LogLevel": { "Default": "Information", "Microsoft.AspNetCore": "Warning" } + }, + "ConnectionStrings": { + "Postgres": "Host=aws-N-REGION.pooler.supabase.com;Port=5432;Database=postgres;Username=postgres.YOURPROJECTREF;Password=REPLACE_ME;SSL Mode=Require;Trust Server Certificate=true" + }, + "Supabase": { + "MetadataAddress": "https://YOURPROJECTREF.supabase.co/auth/v1/.well-known/openid-configuration", + "Issuer": "https://YOURPROJECTREF.supabase.co/auth/v1", + "Audience": "authenticated" + } +} diff --git a/backend/appsettings.json b/backend/appsettings.json new file mode 100644 index 0000000..29724ab --- /dev/null +++ b/backend/appsettings.json @@ -0,0 +1,6 @@ +{ + "Logging": { + "LogLevel": { "Default": "Information", "Microsoft.AspNetCore": "Warning" } + }, + "AllowedHosts": "*" +} diff --git a/backend/backend.csproj b/backend/backend.csproj new file mode 100644 index 0000000..eb5883c --- /dev/null +++ b/backend/backend.csproj @@ -0,0 +1,13 @@ + + + + net9.0 + enable + enable + + + + + + + diff --git a/backend/backend.http b/backend/backend.http new file mode 100644 index 0000000..49b12b7 --- /dev/null +++ b/backend/backend.http @@ -0,0 +1,6 @@ +@backend_HostAddress = http://localhost:5211 + +GET {{backend_HostAddress}}/weatherforecast/ +Accept: application/json + +###