Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
@requestly/mock-server
Advanced tools
- Methods: GET, POST, PUT, OPTIONS - Description - Endpoint (can be full path) (/api/v1/users) - Multiple Responses - Shuffle Response - Sequential Response - Rules in Response - Status (Any status code 2xx, 4xx) - Latency - Body - Templat
Readme
This Repo contains the core express server @requestly/mock-server package which powers Requestly's Cloud Mock Server.
npm i
npm start:dev
npm i @requestly/mock-server
import * as functions from 'firebase-functions';
import { MockServer } from '@requestly/mock-server';
import firebaseConfigFetcher from '../firebaseConfigFetcher';
const startMockServer = () => {
const expressApp = new MockServer(3000, firebaseConfigFetcher, '/api/mockv2').app;
return functions.runWith({ minInstances: isProdEnv() ? 1 : 0 }).https.onRequest(expressApp);
};
export const handleMockRequest = startMockServer();
class FirebaseConfigFetcher implements IConfigFetcher {
getMockSelectorMap = (kwargs?: any) => {
/**
* Fetch and return mockSelectorMap from firestore
* {
* mockId: {
* route: "",
* method: "",
* }
* }
*/
};
getMock = (id: string, kwargs?: any) => {
/**
* Fetch mock details from firestore
*/
}
}
const firebaseConfigFetcher = new FirebaseConfigFetcher();
export default firebaseConfigFetcher;
STEPS
https://username.requestly.dev/users
IConfigFetcher.getMockSelectorMap()
(Firestore in case of Requestly)
b. Select mock if any endpoint+method matches the incoming request (GET /users)
c. Fetch Mock using IConfigFetcher.getMock(mockId)
and pass it to MockProcessorFAQs
- Methods: GET, POST, PUT, OPTIONS - Description - Endpoint (can be full path) (/api/v1/users) - Multiple Responses - Shuffle Response - Sequential Response - Rules in Response - Status (Any status code 2xx, 4xx) - Latency - Body - Templat
The npm package @requestly/mock-server receives a total of 23 weekly downloads. As such, @requestly/mock-server popularity was classified as not popular.
We found that @requestly/mock-server demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 7 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.