using Microsoft.Extensions.Hosting; using Vegasco.Server.AppHost.Shared; IDistributedApplicationBuilder builder = DistributedApplication.CreateBuilder(args); IResourceBuilder postgresBuilder = builder.AddPostgres(Constants.Database.ServiceName) .WithLifetime(ContainerLifetime.Persistent) .WithDataVolume(); if (builder.Environment.IsDevelopment()) { postgresBuilder = postgresBuilder .WithPgWeb() .WithPgAdmin(); } IResourceBuilder postgres = postgresBuilder .AddDatabase(Constants.Database.Name); IResourceBuilder api = builder .AddProject(Constants.Projects.Api) .WithReference(postgres) .WaitFor(postgres); builder .AddNpmApp("Vegasco-Web", "../Vegasco-Web") .WithReference(api) .WaitFor(api) .WithHttpEndpoint(port: 44200, env: "PORT") .WithExternalHttpEndpoints() .WithHttpHealthCheck("/", 200); builder.Build().Run();