Giter Site home page Giter Site logo

vessels-tech / mock-pathfinder Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mdebarros/mock-pathfinder

0.0 2.0 0.0 156 KB

CORE COMPONENT (Mojaloop):DNS server returning mocked Pathfinder query responses

License: Other

Dockerfile 0.57% JavaScript 98.05% Shell 1.38%

mock-pathfinder's Introduction

mock-pathfinder

A mock PathFinder server for development and testing.

The server has two different endpoints, one that supports the PathFinder Query API over DNS, and one that supports the PathFinder Provisioning API over SOAP.

The project is intended to fully replace the PathFinder service with a local version for testing and development purposes. It is not intended to be a replacement for production usage.

Contents:

Deployment

To run the server locally outside of Docker, run the command npm start from the command line. This will start the service and open two ports, 15353 over UDP and 8080 over TCP.

Deploy to Docker

To run the server in your local Docker environment, run the command npm run dev to build and run the container. This will start the service in Docker and open two ports, 15353 over UDP and 8080 over TCP.

Configuration

Environment variables

mock-pathfinder has a handful of options that can be configured through environment variables. Values can also be set in the file config/default.json, but environment variables are preferred.

Environment variable Description Default values Example values
MOPF_DATABASE_URI The connection string for the database mock-pathfinder will use. Postgres is currently the only supported database. n/a postgres://<username>:<password>@localhost:5678/mock_pathfinder
MOPF_QUERY__PORT The UDP port the Query API will exposed on. 15353 15353
MOPF_QUERY__DEFAULT_RECORD The default record will always be returned as a NAPTR record for a phone number retrieved through the Query API.
MOPF_QUERY__DEFAULT_RECORD_order The order value for the default NAPTR record. 10 1
MOPF_QUERY__DEFAULT_RECORD_preference The preference value for the default NAPTR record. 50 30
MOPF_QUERY__DEFAULT_RECORD_flags The flags value for the default NAPTR record. u u
MOPF_QUERY__DEFAULT_RECORD_service The service value for the default NAPTR record. E2U+pstn:tel
MOPF_QUERY__DEFAULT_RECORD_regexp The regular expression value for the default NAPTR record. This value includes the URI and the regular expression separated by a !. !^(.*)$!tel:\1;q_stat=102!
MOPF_QUERY__DEFAULT_RECORD_replacement The replacement value for the default NAPTR record.
MOPF_QUERY__DEFAULT_RECORD_ttl The time-to-live value for the default NAPTR record. 900 300
MOPF_PROVISIONING__PORT The TCP port the Provisioning API will be exposed on. 8080 8080
MOPF_PROVISIONING__PATH The URI path the SOAP Provisioning API will respond on. /nrs-pi/services/SIPIX/SendRequest
MOPF_PROVISIONING__WSDL_FILE The absolute path to the WSDL file the SOAP Provisioning API will use. ./sipix-2.0.0.wsdl
MOPF_PROVISIONING__DEFAULT_CUSTOMER_ID The default Customer ID returned by the Provisioning API. 1234 1234

API

For documentation of the endpoints, see the API documentation. There is also a list of limitations and differences between mock-pathfinder and the PathFinder service.

Logging

Logs are sent to standard output by default.

Tests

Tests include unit and integration.

Unit tests can be ran by running:

npm test

Integration tests can be ran by running:

npm run test:integration

Unit tests include code coverage via istanbul. See the test/ folder for testing scripts.

mock-pathfinder's People

Contributors

ggrg avatar kjw000 avatar lewisdaly avatar mdebarros avatar

Watchers

 avatar  avatar

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.