mirror of
https://git.hexahost.dev/smueller/HexaHost-Frontend.git
synced 2026-06-02 16:48:43 +00:00
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:
58
scripts/run-build.sh
Normal file
58
scripts/run-build.sh
Normal file
@@ -0,0 +1,58 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Erstellt ein Production-Bundle unter dist/ (ohne Branch-Wechsel).
|
||||
#
|
||||
# Nutzung:
|
||||
# ./scripts/run-build.sh
|
||||
# ./scripts/run-build.sh --in-place
|
||||
#
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
IN_PLACE=false
|
||||
|
||||
usage() {
|
||||
cat <<'EOF'
|
||||
Usage: run-build.sh [OPTIONS]
|
||||
|
||||
Options:
|
||||
--in-place Build direkt im Repository (statt dist/)
|
||||
-h, --help Hilfe anzeigen
|
||||
EOF
|
||||
}
|
||||
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case "$1" in
|
||||
--in-place)
|
||||
IN_PLACE=true
|
||||
shift
|
||||
;;
|
||||
-h|--help)
|
||||
usage
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
echo "Unbekannte Option: $1" >&2
|
||||
usage >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
||||
BUILD_DIR="$ROOT/scripts/build"
|
||||
|
||||
if ! command -v npm >/dev/null 2>&1; then
|
||||
echo "FEHLER: npm nicht gefunden. Bitte Node.js installieren." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cd "$BUILD_DIR"
|
||||
npm ci --no-fund --no-audit
|
||||
|
||||
if [[ "$IN_PLACE" == true ]]; then
|
||||
npm run build:in-place
|
||||
else
|
||||
npm run build
|
||||
fi
|
||||
Reference in New Issue
Block a user