Skip to content

Commit 01ec060

Browse files
Use azurite
1 parent d6bf89c commit 01ec060

File tree

3 files changed

+23
-18
lines changed

3 files changed

+23
-18
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,5 @@ pipelines/package-lock.json
2121
bicep/parameters.local.json
2222
local.settings.json
2323
test/settings.example.dan.js
24+
25+
__azurite__

documentation/setup.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,12 @@ In this document:
7272

7373
In your local development environment you will need latest versions of:
7474

75-
* Visual Studio or VSCode
75+
* Visual Studio or VS Code
7676
* git
7777
* `func` CLI
7878
* `az` CLI
7979
* Powershell
80+
* Nodejs & npm
8081

8182
Deploy Azure resources:
8283

@@ -91,14 +92,21 @@ Create local settings:
9192

9293
``` powershell
9394
cd dotnet
95+
96+
# create copies of the Functions settings example files
9497
copy ServerlessMicroservices.FunctionApp.Drivers/local.settings.example.json ServerlessMicroservices.FunctionApp.Drivers/local.settings.json
9598
copy ServerlessMicroservices.FunctionApp.Orchestrators/local.settings.example.json ServerlessMicroservices.FunctionApp.Orchestrators/local.settings.json
9699
copy ServerlessMicroservices.FunctionApp.Passengers/local.settings.example.json ServerlessMicroservices.FunctionApp.Passengers/local.settings.json
97100
copy ServerlessMicroservices.FunctionApp.Trips/local.settings.example.json ServerlessMicroservices.FunctionApp.Trips/local.settings.json
98101
102+
# Now update local settings with your environment's values
103+
99104
cd ../nodejs
105+
106+
# create a copy of the Nodejs settings example file
100107
copy serverless-microservices-functionapp-triparchiver/local.settings.example.json serverless-microservices-functionapp-triparchiver/local.settings.json
101-
# Update local settings with your environment's values
108+
109+
# Now update local settings with your environment's values
102110
```
103111

104112
Build and run local:

scripts/run-local.ps1

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,37 +6,32 @@ $ErrorActionPreference = 'Stop'
66

77
try {
88

9-
# Start the storage emulator
10-
& "C:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator\AzureStorageEmulator.exe" "start"
11-
129
# cd /dotnet
1310
Push-Location ( Join-Path $PSScriptRoot ../dotnet )
1411

15-
# Build and host SPA at http://127.0.0.1:4280/
12+
Write-Host 'Install and start the storage emulator...'
13+
# If this fails with error EADDRINUSE it is because Visual Studio has already started azurite (which is fine)
14+
Start-Process pwsh { -c md __azurite__ -Force && npm install -g azurite && azurite --silent -l __azurite__ }
15+
16+
Write-Host 'Build and host SPA...'
1617
Start-Process pwsh { -c cd ../web/serverless-microservices-web && npm install && copy ../../test/settings.example.js ./public/js/settings.js && npm run serve -- --port 4280 }
1718

18-
# Build and start Trip Archiver Nodejs Function
19+
Write-Host 'Build and start Trip Archiver Nodejs Function...'
1920
Start-Process pwsh { -c cd ../nodejs/serverless-microservices-functionapp-triparchiver && npm install && npm run pack && func start --javascript -p 7075 --cors http://localhost:4280 }
2021

21-
# Start each Function in a new console. Give each one a head start to avoid collisions building shared DLLs
22-
# Build and start Drivers Function
22+
Write-Host 'Build and start Drivers Function...'
2323
Start-Process pwsh { -c cd ServerlessMicroservices.FunctionApp.Drivers && func start --csharp -p 7071 --cors http://localhost:4280 }
2424

25-
Start-Sleep -Seconds 2
26-
# Build and start Trips Function
25+
Write-Host 'Build and start Trips Function...'
2726
Start-Process pwsh { -c cd ServerlessMicroservices.FunctionApp.Trips && func start --csharp -p 7072 --cors http://localhost:4280 }
2827

29-
Start-Sleep -Seconds 2
30-
# Build and start Passengers Function
28+
Write-Host 'Build and start Passengers Function...'
3129
Start-Process pwsh { -c cd ServerlessMicroservices.FunctionApp.Passengers && func start --csharp -p 7073 --cors http://localhost:4280 }
3230

33-
Start-Sleep -Seconds 2
34-
# Build and start Orchestrators Function
31+
Write-Host 'Build and start Orchestrators Function...'
3532
Start-Process pwsh { -c cd ServerlessMicroservices.FunctionApp.Orchestrators && func start --csharp -p 7074 --cors http://localhost:4280 }
3633

37-
Start-Sleep -Seconds 90
38-
# Open the browser
39-
start 'http://localhost:4280/'
34+
Write-Host 'When all builds have finished, open browser at http://localhost:4280/'
4035

4136
}
4237
finally {

0 commit comments

Comments
 (0)