MCPcopy Create free account
hub / github.com/ICBNetwork/web3-Wallet / constructor

Method constructor

e2e/fixtures/fixture-server.js:69–86  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

67
68class FixtureServer {
69 constructor() {
70 this._app = new Koa();
71 this._stateMap = new Map([[DEFAULT_STATE_KEY, Object.create(null)]]);
72
73 this._app.use(async (ctx) => {
74 // Middleware to handle requests
75 ctx.set('Access-Control-Allow-Origin', '*');
76 ctx.set('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE');
77 ctx.set(
78 'Access-Control-Allow-Headers',
79 'Origin, X-Requested-With, Content-Type, Accept',
80 );
81 // Check if it's a request for the current state
82 if (this._isStateRequest(ctx)) {
83 ctx.body = this._stateMap.get(CURRENT_STATE_KEY);
84 }
85 });
86 }
87
88 // Start the fixture server
89 async start() {

Callers

nothing calls this directly

Calls 2

_isStateRequestMethod · 0.95
getMethod · 0.80

Tested by

no test coverage detected