Compare commits

..

2 Commits

Author SHA1 Message Date
d4223ed38f Use port proxying
All checks were successful
continuous-integration/drone/push Build is passing
2025-06-29 12:02:16 +02:00
9f2c5db825 Install npm dependencies as .NET build target 2025-06-29 12:02:16 +02:00
3 changed files with 12 additions and 3 deletions

View File

@@ -3,7 +3,6 @@
"version": "0.0.0", "version": "0.0.0",
"scripts": { "scripts": {
"ng": "ng", "ng": "ng",
"start:withInstall": "pnpm install && pnpm run start",
"start": "run-script-os", "start": "run-script-os",
"start:win32": "ng serve --port %PORT% --configuration development", "start:win32": "ng serve --port %PORT% --configuration development",
"start:default": "ng serve --port $PORT --configuration development", "start:default": "ng serve --port $PORT --configuration development",

View File

@@ -23,10 +23,10 @@ IResourceBuilder<ProjectResource> api = builder
.WaitFor(postgres); .WaitFor(postgres);
builder builder
.AddNpmApp("Vegasco-Web", "../Vegasco-Web", scriptName: "start:withInstall") .AddNpmApp("Vegasco-Web", "../Vegasco-Web")
.WithReference(api) .WithReference(api)
.WaitFor(api) .WaitFor(api)
.WithHttpEndpoint(port: 44200, env: "PORT", isProxied: false) .WithHttpEndpoint(port: 44200, env: "PORT")
.WithExternalHttpEndpoints() .WithExternalHttpEndpoints()
.WithHttpHealthCheck("/", 200); .WithHttpHealthCheck("/", 200);

View File

@@ -25,4 +25,14 @@
<ProjectReference Include="..\Vegasco.Server.Api\Vegasco.Server.Api.csproj" /> <ProjectReference Include="..\Vegasco.Server.Api\Vegasco.Server.Api.csproj" />
</ItemGroup> </ItemGroup>
<Target Name="RestoreNpm" BeforeTargets="Build" Condition=" '$(DesignTimeBuild)' != 'true' ">
<ItemGroup>
<PackageJsons Include="..\*\package.json" />
</ItemGroup>
<!-- Install npm packages if node_modules is missing -->
<Message Importance="Normal" Text="Installing npm packages for %(PackageJsons.RelativeDir)" Condition="!Exists('%(PackageJsons.RootDir)%(PackageJsons.Directory)/node_modules')" />
<Exec Command="pnpm install" WorkingDirectory="%(PackageJsons.RootDir)%(PackageJsons.Directory)" Condition="!Exists('%(PackageJsons.RootDir)%(PackageJsons.Directory)/node_modules')" />
</Target>
</Project> </Project>