start.ps1 419 B

1234567891011121314
  1. param(
  2. [int]$Port = 8099
  3. )
  4. $ErrorActionPreference = 'Stop'
  5. $here = Split-Path -Parent $MyInvocation.MyCommand.Path
  6. $node = Get-Command node -ErrorAction SilentlyContinue
  7. if (-not $node) {
  8. throw '未找到 node,请先安装 Node.js 或把 node 加入 PATH。'
  9. }
  10. Write-Host "启动代码对比工具: http://127.0.0.1:$Port"
  11. Write-Host '按 Ctrl+C 结束。'
  12. & $node.Source (Join-Path $here 'server.mjs') $Port