Skip to content

Commit

Permalink
fixes #95
Browse files Browse the repository at this point in the history
  • Loading branch information
dantelmomsft committed Aug 9, 2024
1 parent 0b9c7c5 commit 1406732
Show file tree
Hide file tree
Showing 7 changed files with 2,336 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
{
"label": "Start App ",
"type": "shell",
"command": "${workspaceFolder}/app/start.sh",
"command": "${workspaceFolder}/deploy/app-service/start.sh",
"windows": {
"command": "pwsh ${workspaceFolder}/app/start.ps1"
"command": "pwsh ${workspaceFolder}/deploy/app-service/start.ps1"
},
"presentation": {
"reveal": "always"
Expand Down
2,306 changes: 2,306 additions & 0 deletions app/frontend/package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions app/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,18 @@
"preview": "vite preview"
},
"dependencies": {
"@azure/msal-react": "^2.0.4",
"@azure/msal-browser": "^3.1.0",
"@azure/msal-react": "^2.0.4",
"@fluentui/react": "^8.112.5",
"@fluentui/react-components": "^9.37.3",
"@fluentui/react-icons": "^2.0.221",
"@react-spring/web": "^9.7.3",
"dompurify": "^3.0.6",
"frontend": "file:",
"ndjson-readablestream": "^1.0.7",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.18.0",
"ndjson-readablestream": "^1.0.7",
"scheduler": "^0.20.2"
},
"devDependencies": {
Expand All @@ -33,6 +34,5 @@
"prettier": "^3.0.3",
"typescript": "^5.2.2",
"vite": "^4.5.3"

}
}
6 changes: 6 additions & 0 deletions deploy/app-service/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 11 additions & 2 deletions app/start.ps1 → deploy/app-service/start.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if ($LASTEXITCODE -ne 0) {
Write-Host ""
Write-Host "Restoring frontend npm packages"
Write-Host ""
Set-Location ./frontend
Set-Location ../../app/frontend
npm install
if ($LASTEXITCODE -ne 0) {
Write-Host "Failed to restore frontend npm packages"
Expand All @@ -35,11 +35,20 @@ if ($LASTEXITCODE -ne 0) {
exit $LASTEXITCODE
}

Write-Host ""
Write-Host "Copying build files to backend static resources"
Write-Host ""
$staticPath = "../backend/src/main/resources/static"
if (-Not (Test-Path -Path $staticPath)) {
New-Item -ItemType Directory -Path $staticPath
}
Copy-Item -Path "./build/*" -Destination $staticPath -Recurse -Force

Write-Host ""
Write-Host "Starting spring boot api backend and react spa from backend/public static content"
Write-Host ""
Set-Location ../backend
Start-Process http://localhost:8080
#Start-Process http://localhost:8080

Start-Process -FilePath "./mvnw.cmd" -ArgumentList "spring-boot:run -Dspring-boot.run.profiles=dev" -Wait -NoNewWindow

Expand Down
8 changes: 7 additions & 1 deletion app/start.sh → deploy/app-service/start.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ echo ""
echo "Restoring frontend npm packages"
echo ""

cd ./frontend
cd ../../app/frontend
npm install
if [ $? -ne 0 ]; then
echo "Failed to restore frontend npm packages"
Expand All @@ -38,6 +38,12 @@ if [ $? -ne 0 ]; then
exit $?
fi

# Create static folder if it doesn't exist
mkdir -p ../backend/src/main/resources/static

# Copy files from build folder to static folder
cp -r build/* ../backend/src/main/resources/static/

echo ""
echo "Starting spring boot api backend and react spa from backend/public static content"
echo "Spring-boot application.properties use values from azd .env file which have been exported as environment variables"
Expand Down
2 changes: 1 addition & 1 deletion docs/app-service/README-App-Service.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ azd up
az login
```
2. Change dir to `app`
2. Change dir to `deploy\app-service`
```shell
cd app
Expand Down

0 comments on commit 1406732

Please sign in to comment.