Fix: api.hashpass.tech DNS Configuration
Current Problem
api.hashpass.tech is currently pointing to Amplify Hosting (CloudFront), not API Gateway. This is why you're getting 404 errors.
Evidence:
- DNS resolves to CloudFront IPs:
18.155.252.x - HTTP response shows:
server: AmazonS3andvia: CloudFront - Returns 301 redirects instead of API responses
Solution Options
Option 1: Point api.hashpass.tech to API Gateway (Recommended)
Prerequisites:
- API Gateway must be configured with custom domain
api.hashpass.tech - Lambda function must be deployed
Steps:
-
Get API Gateway Domain Name:
- Go to API Gateway Console → Custom Domain Names
- Find
api.hashpass.techdomain - Copy the "API Gateway domain name" (e.g.,
d-xxxxx.execute-api.us-east-1.amazonaws.com)
-
Update DNS in Route 53:
- Go to Route 53 → Hosted Zones →
hashpass.tech - Find CNAME record for
api - Update the value to the API Gateway domain name
- Save
- Go to Route 53 → Hosted Zones →
-
Wait for DNS propagation (usually 5-15 minutes)
-
Test:
curl https://api.hashpass.tech/api/config/versions
Option 2: Use Different Subdomain for API Gateway
If you want to keep api.hashpass.tech for Amplify Hosting:
-
Create new subdomain (e.g.,
api-gateway.hashpass.techorapi-proxy.hashpass.tech) -
Configure in API Gateway:
- Create custom domain with new subdomain name
- Map to your API
-
Update DNS:
- Create CNAME record for new subdomain
- Point to API Gateway domain
-
Update frontend code:
- Change
EXPO_PUBLIC_API_BASE_URLto new subdomain
- Change
Option 3: Use Cloudflare Pages (Alternative)
If API Gateway is too complex, use Cloudflare Pages which handles API routes automatically:
npm run deploy:cloudflare
Then update DNS to point api.hashpass.tech to Cloudflare Pages.
Verification
After making DNS changes:
# Check DNS resolution
dig api.hashpass.tech
# Should show API Gateway domain, not CloudFront
# Example: d-xxxxx.execute-api.us-east-1.amazonaws.com
# Test API endpoint
curl https://api.hashpass.tech/api/config/versions
Current DNS Status
Based on verification:
api.hashpass.tech→18.155.252.x(CloudFront/Amplify Hosting) ❌- Should be → API Gateway domain ✅
Next Steps
-
If API Gateway is configured:
- Update DNS CNAME to point to API Gateway domain
- Wait for propagation
- Test endpoint
-
If API Gateway is NOT configured:
- Follow
API-GATEWAY-TROUBLESHOOTING.mdto set up API Gateway first - Then update DNS
- Follow
-
Alternative:
- Use Cloudflare Pages for API routes (simpler, free)
- Or use Netlify Functions