diff options
| author | leonoverweel <l.overweel@gmail.com> | 2017-04-04 15:18:06 +0200 |
|---|---|---|
| committer | leonoverweel <l.overweel@gmail.com> | 2017-04-04 15:18:06 +0200 |
| commit | 2a4954077362d7b81a36a59580487972453180b4 (patch) | |
| tree | 67e35f5f903c8e097904b8df7164d4689c4843a1 | |
| parent | d1314ab6ae5feffd6ce97efc5c013581c1de3d0a (diff) | |
Add account setup to local setup guide in README
| -rw-r--r-- | OpenDC.postman_collection.json | 29 | ||||
| -rw-r--r-- | README.md | 14 |
2 files changed, 35 insertions, 8 deletions
diff --git a/OpenDC.postman_collection.json b/OpenDC.postman_collection.json index 71f1231c..2fa03f58 100644 --- a/OpenDC.postman_collection.json +++ b/OpenDC.postman_collection.json @@ -2,7 +2,7 @@ "variables": [], "info": { "name": "OpenDC", - "_postman_id": "bd4d0e57-7918-dc69-3ead-6c19e20ab0b0", + "_postman_id": "e8b68f59-29cb-71d0-6237-b22932c40f9c", "description": "Sample requests for developing the OpenDC API", "schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json" }, @@ -26,7 +26,32 @@ ], "body": { "mode": "raw", - "raw": "{\r\n\t\"simulation\": {\r\n\t\t\"name\": \"Simulation Name\"\r\n\t}\r\n}" + "raw": "{\r\n \"simulation\": {\r\n \"name\": \"Simulation Name\"\r\n }\r\n}" + }, + "description": "" + }, + "response": [] + }, + { + "name": "Create New User", + "request": { + "url": "localhost:8081/api/v1/users", + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "description": "" + }, + { + "key": "auth-token", + "value": "PUT YOUR AUTH TOKEN HERE", + "description": "" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"user\": {\r\n \"email\": \"email@example.com\"\r\n }\r\n}" }, "description": "" }, @@ -91,13 +91,17 @@ Make the following replacements: In `opendc-web-server/static/index.html`, add your own `OAUTH_CLIENT_ID` in `content=` on line `2`. -#### Set up Postman +#### Set up Postman and OpenDC account To easily make HTTP requests to the web server, we recommend Postman (get it [here](https://www.getpostman.com/)). -Once Postman is installed and set up, `Import` the OpenDC requests collection (`OpenDC.postman_collection.json`). In the `Collections` tab, expand `OpenDC` and click `Create New Simulation`. This should open the request in the `Builder` pane. +Once Postman is installed and set up, `Import` the OpenDC requests collection (`OpenDC.postman_collection.json`). In the `Collections` tab, expand `OpenDC` and click `Create New User`. This should open the request in the `Builder` pane. -Navigate to `http://localhost:8081/my-auth-token` and copy the authentication token on this page to your clipboard. In the Postman `Builder` pane, navigate to the `Headers (2)` tab, and paste the authentication token as value for the `auth-token` header. (This token expires every hour - refresh the auth token page to get a new token.) +Navigate to `http://localhost:8081/my-auth-token` and copy the authentication token on this page to your clipboard. In the Postman `Builder` pane, navigate to the `Headers (2)` tab, and paste the authentication token as value for the `auth-token` header. (This token expires every hour - refresh the auth token page to get a new token.) + +(Optional: navigate to the `Body` tab and change the email address to the gmail address you used to get an authentication token.) + +Click `Send` in Postman to send your request and see the server's response. If it's a `200`, your account is set up! ### Local Development @@ -108,8 +112,6 @@ cd opendc-web-server python main.py config.json ``` -Click `Send` in Postman to send your request and see the server's response. - -To try a different query, use the Postman `Builder` to edit the method, path, body, query parameters, etc. +To try a different query, use the Postman `Builder` to edit the method, path, body, query parameters, etc. `Create New Simulation` is provided as an additional example. When editing the web server code, restart the server (`CTRL` + `c` followed by `python main.py config.json` in the console running the server) to see the result of your changes. |
