JSPM

  • Created
  • Published
  • Downloads 1038
  • Score
    100M100P100Q113509F
  • License BUSL-1.1

Standalone Node mock server dla Echelon — HTTP + WebSocket z deklaratywnym fixture + symulatorem.

Package Exports

  • @echelon-framework/mock-server
  • @echelon-framework/mock-server/cli

Readme

@echelon-framework/mock-server

Standalone Node mock backend (HTTP + WebSocket) z deklaratywnym fixture.

Installation

npm install -g @echelon-framework/mock-server
echelon-mock-server --config mock-server.json

Config

mock-server.json:

{
  port: 3001,
  responses: {
    clients: @file:./fixtures/clients.json,
    transactions: @file:./fixtures/transactions.json
  },
  streams: {
    rates.usdpln: {
      simulate: {
        kind: fx-random-walk,
        mid: 4.0515, vol: 0.0003,
        intervalMs: 350
      }
    }
  }
}

Endpoints

  • GET /health — healthcheck
  • GET /api/:resource — fixture lookup
  • POST /api/:resource — echo + journal
  • ws://host:port/ws — subscribe {subscribe: channel}{type: data, channel, data}