No more localhost problems
A mock server on your laptop is awkward on mobile. On a phone, localhost is the phone itself. The Android emulator needs 10.0.2.2. iOS blocks plain HTTP by default, and teammates cannot reach your machine at all without a tunnel.
MockLab endpoints are public HTTPS URLs, so the same base URL works in the iOS simulator, the Android emulator, Expo Go on a real phone and a colleague’s device.
Test the flows that break on mobile
- Login with real signed tokens, then storing them in SecureStore or the Keychain
- Refreshing an expired token when the app comes back from the background
- Logging the user out when a protected endpoint returns 401
- Infinite scroll with a ?page=2 variant that returns the next page
- Loading and error states with a delay of up to 10 seconds or a 500 response
Point your API client at MockLab
import axios from "axios";
import * as SecureStore from "expo-secure-store";
export const api = axios.create({
baseURL: process.env.EXPO_PUBLIC_API_URL ?? "https://api.mocklab.studio/mock/your-project",
});
api.interceptors.request.use(async (config) => {
const token = await SecureStore.getItemAsync("accessToken");
if (token) config.headers.Authorization = `Bearer ${token}`;
return config;
});When the real backend is ready, change EXPO_PUBLIC_API_URL. Nothing else in the app needs to change.
Frequently asked questions
Does it work with Expo Go?
Yes. MockLab is a normal HTTPS API, so fetch, axios or any other HTTP client works in Expo Go, development builds and bare React Native apps.
Do I need special settings for the Android emulator?
No. Because the endpoints are public HTTPS URLs, you do not need 10.0.2.2 or a cleartext traffic exception.
Does it work offline?
No. MockLab is hosted, so the device needs an internet connection.
Is MockLab free?
Yes, MockLab is free while it is in beta. No credit card required.
Stop waiting on the backend
Create your first endpoint in under a minute. It's live at a public URL as soon as you save it.