A simple PHP REST server for integration tests with UU networking components.
./scripts/start_local.sh
./scripts/stop_local.shOr manually:
php -S 127.0.0.1:8080 -t php php/index.phpUploads use /tmp/uu-upload unless UU_FILE_FOLDER is set.
- Health:
http://127.0.0.1:8080/ - Standalone scripts:
http://127.0.0.1:8080/form.php,echo_json.php, etc. - Routed APIs:
http://127.0.0.1:8080/echo/json(same as?do=echo/json)
The built-in server and Lambda do not use php/.htaccess (Apache only). Routing is in index.php and common.php.
For iOS Simulator tests, set test_server_api_host in UUNetworkingTestConfig.plist to http://127.0.0.1:8080.
Prereqs: AWS CLI credentials, PHP + Composer, Node (npx).
./scripts/deploy_lambda.shDefaults: stage prod, region us-west-2. Or:
composer install --no-dev
npx serverless@3 deployAfter deploy, note the HTTP API invoke URL (e.g. https://xxxx.execute-api.us-west-2.amazonaws.com). Use it to verify before/custom domain DNS:
curl -sf "https://xxxx.execute-api.us-west-2.amazonaws.com/"
# UUNetworkingTestServer OKSee docs/bref-serverless-from-scratch.md for full setup and troubleshooting (binary uploads/downloads, PHP version, etc.).
serverless.yml already enables Bref binary HTTP (binaryMediaTypes, BREF_BINARY_RESPONSES) for form.php and download.php.
Production hostname points directly at API Gateway (HTTP API custom domain → Lambda). There is no separate CloudFront distribution in front of the PHP API.
- ACM certificate in us-west-2 (same region as
serverless.yml) foruu.spsw.io, DNS-validated. - API Gateway → Custom domain names → create
uu.spsw.io(prefer Regional endpoint), attach the cert. - API mappings → map the domain to your HTTP API, stage
$default, empty path (so/form.phpstays/form.php). - DNS → CNAME
uuto the API Gateway domain target (e.g.d-xxxxx.execute-api.us-west-2.amazonaws.comfrom the console).
Details and troubleshooting: docs/custom-domain-api-gateway.md.
iOS / integration tests: test_server_api_host = https://uu.spsw.io.
Note: API Gateway may still add CloudFront-related response headers on some custom-domain configurations; that is AWS-managed, not your old manual CloudFront setup. If POST /form.php fails with HTML “Request blocked”, check WAF on any distribution still associated with the hostname, or test against the raw execute-api URL to isolate Lambda vs edge.
Large static assets (zips, .well-known) live under static-public/ and sync to S3 — not served by Lambda. See docs/s3-static-hosting.md when you wire up a separate hostname or CloudFront origin for static content.