Giter Club home page Giter Club logo

notifications-sms-provider-stub's Introduction

notifications-sms-provider-stub

This is a simple Go server that can be used as a stub for Notify SMS providers during a load test or when running the application locally. It accepts the requests for a notification, prints the message contents, returns an HTTP response and after a short delay sends a callback to a pre-configured URL.

Setting up

Install go

You need a Go compiler to build the binary (brew install go).

environment.sh (optional)

You can tweak the configuration using the following variables.

echo "
export PORT=6300  # server port

export MMG_MIN_DELAY_MS=100  # min delay before callback is sent in ms
export MMG_MAX_DELAY_MS=1000 # max delay before callback is sent in ms
export MMG_CALLBACK_URL='http://localhost:6011/notifications/sms/mmg'

# similarly for each other provider
"> environment.sh

To run the application

To build and run the server locally:

make run

This will start a server on port 6300, configured to send the callbacks to a local Notify API. To configure Notify API to use the server instead of actual MMG and Firetext set the environment.sh variables in the Notify API:

export MMG_URL='http://localhost:6300/mmg'

# similarly for each other provider

How to make the API use this email provider stub

To turn it on for an app running ensure you set the following environment variables:

FIRETEXT_URL=http://notify-sms-provider-stub-staging.apps.internal:8080/firetext MMG_URL=http://notify-sms-provider-stub-staging.apps.internal:8080/mmg

notifications-sms-provider-stub's People

Contributors

allait avatar benthorner avatar corlettb avatar idavidmcdonald avatar klssmith avatar rjbaker avatar sakisv avatar samuelhwilliams avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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.