添加一键启动脚本

This commit is contained in:
ShaoHua
2026-01-22 23:15:09 +08:00
parent c7a9a267ff
commit 67713e9ad5
2 changed files with 30 additions and 1 deletions
+11 -1
View File
@@ -1,4 +1,4 @@
# Hua.Abp.Demo
# Hua.Abp.Demo
## About this solution
@@ -20,6 +20,16 @@ The solution comes with a default configuration that works out of the box. Howev
* Run `abp install-libs` command on your solution folder to install client-side package dependencies. This step is automatically done when you create a new solution, if you didn't especially disabled it. However, you should run it yourself if you have first cloned this solution from your source control, or added a new client-side package dependency to your solution.
* Run `Hua.Abp.Demo.DbMigrator` to create the initial database. This step is also automatically done when you create a new solution, if you didn't especially disabled it. This should be done in the first run. It is also needed if a new database migration is added to the solution later.
### Quick Start (One-click Run)
We have provided a convenient PowerShell script to start both the Backend (HttpApi.Host) and Frontend (Angular) services simultaneously in separate windows.
Run the following command in the solution root directory:
```powershell
.\run-dev.ps1
```
#### Generating a Signing Certificate
In the production environment, you need to use a production signing certificate. ABP Framework sets up signing and encryption certificates in your application and expects an `openiddict.pfx` file in your application.
+19
View File
@@ -0,0 +1,19 @@
$ScriptPath = Split-Path -Parent $MyInvocation.MyCommand.Definition
Set-Location $ScriptPath
Write-Host "Starting Back-end (HttpApi.Host)..." -ForegroundColor Green
# Start backend in a new window
Start-Process powershell -ArgumentList '-NoExit', '-Command', 'dotnet run --project "src/Hua.Abp.Demo.HttpApi.Host/Hua.Abp.Demo.HttpApi.Host.csproj"'
Write-Host "Starting Front-end (Angular)..." -ForegroundColor Green
Set-Location "$ScriptPath/angular"
# Start frontend in a new window using existing script if available
if (Test-Path "start.ps1") {
Start-Process powershell -ArgumentList '-NoExit', '-File', ".\start.ps1"
} else {
Start-Process powershell -ArgumentList '-NoExit', '-Command', "yarn; yarn start"
}
Set-Location $ScriptPath
Write-Host "🚀 Services are starting in new windows..." -ForegroundColor Cyan