gorush/tests
Bo-Yi Wu e89ea00626 docs: update test script.
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2022-05-08 12:23:42 +08:00
..
README.md docs: update test script. 2022-05-08 12:23:42 +08:00
test.json docs: update test script. 2022-05-08 12:23:42 +08:00

README.md

Testing

How to test gorush with http request?

download bat tool

Download cURL-like tool for humans.

testing

see the JSON format:

{
  "notifications": [
    {
      "tokens": ["token_a", "token_b"],
      "platform": 1,
      "message": "Hello World iOS!"
    },
    {
      "tokens": ["token_a", "token_b"],
      "platform": 2,
      "message": "Hello World Android!"
    }
  ]
}

run the following command.

bat POST localhost:8088/api/push < tests/test.json

Here is a sample shell code to calculate factorial using while loop:

#!/bin/bash
counter=$1
while [ $counter -gt 0 ]
do
  bat POST https://gorush.netlify.app/api/push < tests/test.json
  counter=$(( $counter - 1 ))
  echo $counter
done