Skip to content

Commit

Permalink
Define Proxy for Production
Browse files Browse the repository at this point in the history
  • Loading branch information
chidozieononiwu committed Oct 9, 2023
1 parent aefd20e commit 66c1b46
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 11 deletions.
5 changes: 3 additions & 2 deletions src/dotnet/APIView/ClientSPA/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,12 @@
"builder": "@angular-devkit/build-angular:dev-server",
"configurations": {
"production": {
"browserTarget": "ClientAPP:build:production"
"browserTarget": "ClientAPP:build:production",
"proxyConfig": "src/proxy.conf.json"
},
"development": {
"browserTarget": "ClientAPP:build:development",
"proxyConfig": "src/proxy.conf.json"
"proxyConfig": "src/development.proxy.conf.json"
}
},
"defaultConfiguration": "development"
Expand Down
2 changes: 1 addition & 1 deletion src/dotnet/APIView/ClientSPA/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build --output-path=../APIViewWeb/wwwroot/spa --configuration production --base-href https://v2.apiviewuxtest.com/",
"build": "ng build --configuration production",
"watch": "ng build --watch --configuration development",
"test": "ng test"
},
Expand Down
6 changes: 6 additions & 0 deletions src/dotnet/APIView/ClientSPA/src/development.proxy.conf.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"/api": {
"target": "http://localhost:5000",
"secure": false
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export const environment = {
production: true,
apiUrl: 'api/',
webAppUrl: ''
webAppUrl: 'https://apiviewstaging.azurewebsites.net/'
};
6 changes: 6 additions & 0 deletions src/dotnet/APIView/ClientSPA/src/proxy.conf copy.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"/api": {
"target": "https://apiviewstaging.azurewebsites.net",
"secure": true
}
}
6 changes: 0 additions & 6 deletions src/dotnet/APIView/ClientSPA/src/proxy.conf.json

This file was deleted.

9 changes: 8 additions & 1 deletion src/dotnet/APIView/apiview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,18 @@ stages:
arguments: '--configuration $(BuildConfiguration) --output $(Build.ArtifactStagingDirectory)'
zipAfterPublish: true

- task: PublishBuildArtifacts@1
workingDirectory: $(SPAClientProjectDirectory)
inputs:
PathtoPublish: 'dist/client-app'
ArtifactName: 'spa-app'
displayName: 'Publish SPA Artifacts'

- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)'
artifactName: 'APIView'
displayName: 'Publish Web Artifacts'

- job: 'Test'

Expand Down

0 comments on commit 66c1b46

Please sign in to comment.