Map Local & Map Remote
Map Local and Map Remote allow you to transparently route network requests to local files on your desktop machine or map API domains to alternative remote staging environments.
1. Map Local (Serve Local Files as API Responses)
Map Local routes matching HTTP/HTTPS API requests directly to static files stored on your local hard drive (e.g. JSON files, images, HTML documents).
How to Configure Map Local:
- Open Trafexia Desktop -> Go to Rules & Mocking -> Select Map Local.
- Click Add Map Local Rule.
- Specify the Target URL pattern (e.g.
https://api.example.com/v1/config). - Select a local file path (e.g.
/Users/dev/mocks/config.json). - Save and enable the rule.
When your mobile app requests https://api.example.com/v1/config, Trafexia will instantly respond with the contents of your local config.json file.
2. Map Remote (Transparent Domain & Path Mapping)
Map Remote redirects requests from one server destination to another destination transparently, modifying the Request Host, Scheme, or Path on the fly.
How to Configure Map Remote:
- Open Trafexia Desktop -> Go to Rules & Mocking -> Select Map Remote.
- Click Add Map Remote Rule.
- Configure Source Match:
- Host:
api.production.com - Path:
/v1/*
- Host:
- Configure Destination Redirection:
- Host:
api.staging-internal.dev - Protocol:
https - Port:
443
- Host:
- Save and enable the rule.
Mobile traffic intended for production will automatically be routed to your internal staging API server without rebuilding the mobile binary.