Skip to content

Commit

Permalink
feat(api): adding jetbrain rest/http client testing tool
Browse files Browse the repository at this point in the history
  • Loading branch information
xmlking committed Jun 20, 2019
1 parent 3ce2827 commit 15ef31d
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 0 deletions.
26 changes: 26 additions & 0 deletions apps/api/rest-client.env.json
@@ -0,0 +1,26 @@
{

"development": {
"oidc-issuer-url": "https://keycloak.kashmora.com/auth/realms/ngx",
"api-url": "http://localhost:3000",
"username": "sumo3",
"password": "demo",
"client-id": "ngxapi"
},

"development-admin": {
"oidc-issuer-url": "https://keycloak.kashmora.com/auth/realms/ngx",
"api-url": "http://localhost:3000",
"username": "ngxadmin",
"password": "ngxadmin",
"client-id": "ngxapi"
},

"production": {
"oidc-issuer-url": "https://keycloak.kashmora.com/auth/realms/ngx",
"api-url": "https://api.kashmora.com",
"username": "sumo3",
"password": "demo",
"client-id": "ngxapi"
}
}
34 changes: 34 additions & 0 deletions apps/api/trst-rest-api.http
@@ -0,0 +1,34 @@
### Generate JWT access token
POST {{oidc-issuer-url}}/protocol/openid-connect/token
Content-Type: application/x-www-form-urlencoded

username={{username}}&password={{password}}&client_id={{client-id}}&grant_type=password&scope=openid

> {%
client.global.set("access_token", response.body.access_token);
%}

### Test create notification
POST {{api-url}}/api/notifications
content-type: application/json; charset=utf-8
Authorization: Bearer {{access_token}}

{"title":"test123","body":"test12345","target":"sumo-topic","targetType":"topic","icon":"notifications","color":"warn","native":true}

### Test get notifications
GET {{api-url}}/api/notifications
Accept: application/json
Authorization: Bearer {{access_token}}


### Test send notification
POST {{api-url}}/api/notifications/send
content-type: application/json; charset=utf-8
Authorization: Bearer {{access_token}}

{ "id" : "6a06cb98-1a3f-43ac-84e1-2312097decf9", "target": "sumo-topic" }

###



0 comments on commit 15ef31d

Please sign in to comment.