Enhance API functionality and security: Added rate limiting and domain validation across multiple API endpoints, improved error handling for missing or invalid parameters, and refactored email handling in contact form for better security and maintainability. Updated README.md with production build instructions and prerequisites.
This commit is contained in:
46
scripts/run-build.ps1
Normal file
46
scripts/run-build.ps1
Normal file
@@ -0,0 +1,46 @@
|
||||
#Requires -Version 5.1
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Erstellt ein Production-Bundle unter dist/ (ohne Branch-Wechsel).
|
||||
#>
|
||||
[CmdletBinding()]
|
||||
param(
|
||||
[switch]$InPlace
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
$Root = (Resolve-Path (Join-Path $PSScriptRoot "..")).Path
|
||||
$BuildDir = Join-Path $Root "scripts\build"
|
||||
|
||||
function Resolve-NodeTool([string]$ToolName) {
|
||||
$command = Get-Command $ToolName -ErrorAction SilentlyContinue
|
||||
if ($command) { return $command.Source }
|
||||
|
||||
$candidates = @(
|
||||
(Join-Path $env:ProgramFiles "nodejs\$ToolName.cmd"),
|
||||
(Join-Path ${env:ProgramFiles(x86)} "nodejs\$ToolName.cmd")
|
||||
)
|
||||
|
||||
foreach ($candidate in $candidates) {
|
||||
if (Test-Path $candidate) { return $candidate }
|
||||
}
|
||||
|
||||
return $null
|
||||
}
|
||||
|
||||
$npm = Resolve-NodeTool "npm"
|
||||
if (-not $npm) {
|
||||
throw "npm nicht gefunden. Bitte Node.js installieren."
|
||||
}
|
||||
|
||||
Set-Location $BuildDir
|
||||
& $npm ci --no-fund --no-audit
|
||||
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
|
||||
|
||||
if ($InPlace) {
|
||||
& $npm run build:in-place
|
||||
} else {
|
||||
& $npm run build
|
||||
}
|
||||
|
||||
exit $LASTEXITCODE
|
||||
Reference in New Issue
Block a user