Back
June 30, 2023
Learning Centre
3
min read

How to Map Local (File)

Sahil Gupta
Co-founder @ Requestly
On this page

Introduction

Map Local feature lets you serve the content of any local file as the response to an intercepted request in real time. This can greatly speed up development and testing as you can make changes in the file locally and test them live without updating them on the server.

Use Cases

  • Map production JS/CSS/HTML files to local files for testing.
  • Create Mock APIs using local files and use them in production.

How to Use Map Local?

In this example, we'll use Requestly's map local feature to serve the content of https://example.com from a local file. Here’s a quick peek at what we’ll do using Map Local. To do this, follow these steps:

  1. Download and Install the Requestly desktop app.
  2. Open the app, and click Connect Apps.
  3. Choose the browser you want to launch and open https://example.com
  4. In the Network Traffic table in the Requestly app, right-click on the request (example.com) and then select Redirect URL (Map Local/Remote)
  5. Select [Map Local](<https://docs.requestly.io/desktop-app/mac/features/map-local>) option and select the file from which you must serve the content.
  6. Click Create Rule and reload the website again to see the updated results.

Requestly is an Open-Source frontend development platform with essential tooling & integrations that helps frontend developers write, test & debug their code 10x faster. Using Requestly, you can create mock API endpoints, test, validate & override API responses, modify request & response headers, setup redirects (Map local, Map remote) and use Requestly sessions for faster debugging.

SHARE THIS POST

Ready to get started?

Empowering frontend developers to achieve more in development, testing & debugging workflows.