GithubHelp home page GithubHelp logo

mparticle-validation-server's Introduction

mp-validation-server

Setup and Install

note: there is no need to install the mp-cli manually and configure, this abstracts all of that

  1. Install dependencies npm i
  2. Copy .env.template to .env and populate it with your mParticle Data Plan API credentials and dataplan details (these can be overridded in http request)
  3. Start in dev using npm run debug or run in docker container, npm run build && npm start

Usage

  • The server runs at http://localhost:3000 by default (if using docker, modify port-mapping to expose an alternate port).
  • Point an http client (ie Postman) at your server
  • Optionally, set http request headers MP-DataplanVersion & MP-DataplanId to override env variables
  • Send an mParticle event batch to your validation server!

Integrating in test suite

Running integration tests will simulate sending data to mParticle's server will can catch and flag malformed events locally without having to provision additional developer mP accounts, educate developers on mP dataplans & dashboard, and manually configure and integrate mP-CLI tools. Simply mock the mParticle client's dispatch method (upload_events <Py> , uploadEvents <node>, UploadEvents , etc. depending on your environment) to send requests to the local validation server. To test this out, run the docker validation server and then npm test.

Demo

Usage This shows basic usage: first a valid request followed
by a request that doesn't match the mParticle data plan schema
Usage This shows the ability to specify the
dataplan and version in the request headers

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.