test: add doc for testing gorush

This commit is contained in:
Bo-Yi Wu 2018-04-11 10:46:31 +08:00
parent e96811ae63
commit 069efa9e5e
2 changed files with 48 additions and 0 deletions

34
tests/README.md Normal file
View File

@ -0,0 +1,34 @@
# Testing
How to test gorush with http request?
## download bat tool
Download [cURL-like tool for humans](https://github.com/astaxie/bat).
## testing
see the JSON format:
```json
{
"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.
```sh
$ bat POST localhost:8088/api/push < tests/test.json
```

14
tests/test.json Normal file
View File

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