From 5fd611ab51b09d69375edbafabcabb4af7525800 Mon Sep 17 00:00:00 2001 From: wancat Date: Mon, 24 Jul 2023 15:06:48 +0800 Subject: [PATCH] docs: improve comments and remove unnecessary lines - Add a comment about creating a session with a POST request to `/api/v1/sessions` - Remove the line mentioning `yarn cli` command - Add a comment about using the `_id` field in the response - Remove the example usage of `yarn cli` Signed-off-by: wancat --- README.md | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 21d4c9e..2b70dd9 100644 --- a/README.md +++ b/README.md @@ -40,8 +40,22 @@ yarn app ## CLI terminal client -Open server first, then +Open server first, then create a session by `POST /api/v1/sessions` + +```bash +curl -X 'POST' \ + 'http://localhost:3000/api/v1/sessions' \ + -H 'accept: application/json' \ + -H 'Content-Type: application/json' \ + -d '{ + "quest_id": "helloworld" +}' +``` + +Then use the `_id` field in response ``` -yarn cli +yarn cli [_id] +# example +yarn cli 64be226a39c0043cd1cdf7c2 ```