Public Repository

Last pushed: 2 months ago
Short Description
A fake MongoosePush server for unit and integration tests
Full Description

MongoosePush fake

DockerHub | GitHub | Wercker

A fake MongoosePush server for unit and integration tests.

Setup

Pull the Docker image and start it, no configuration is required:

docker pull costadigital/mongoosepush-fake
docker run --rm -it -p 8443:8443 costadigital/mongoosepush-fake

The container includes self-signed SSL certificates, it may be necessary to
add them to the certificate keychain.

Usage

Currently, only API version v1 is implemented, so all push notifications must
be sent to the following endpoint:

POST /v1/notification/:token
{
  "topic": "...",
  "title": "Alice",
  "tag": "Alice",
  "service": "apns",
  "mode": "prod",
  "click_action": "...",
  "body": "Hey Bob!",
  "badge": 1
}

The fake server keeps track of all POST requests internally and exposes them
through a GET endpoint, so it can be determined whether an external services
called into MongoosePush or not. The payload for a specific request can be
retrieved using the token which was used for the POST request:

GET /_payload/:token

This will return the payload which was sent earlier, so it can be checked in
a test:

{
  "topic": "...",
  "title": "Alice",
  "tag": "Alice",
  "service": "apns",
  "mode": "prod",
  "click_action": "...",
  "body": "Hey Bob!",
  "badge": 1
}
Docker Pull Command
Owner
costadigital

Comments (0)