Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
tigransimonyan authored Mar 7, 2024
1 parent 6bf974d commit 150fd36
Showing 1 changed file with 1 addition and 73 deletions.
74 changes: 1 addition & 73 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Options can be passed via data attributes for comment section.
## CDN

```html
<script src="https://cdn.jsdelivr.net/gh/zoomment/[email protected]/docs/zoomment.min.js"></script>
<script src="https://cdn.zoomment.com/zoomment.min.js"></script>
```

## Development
Expand All @@ -63,75 +63,3 @@ Open http://localhost:1234 to view it in the browser.
```
$ npm run build
```

## API Reference

### Add Comment

```
POST {{YOUR_API_URL}}/api/comments
```

Request Body:

```
{
"body": "Hello!",
"pageId: "zoomment.github.io/zoomment-widget/page-1",
"pageUrl: "https://zoomment.github.io/zoomment-widget/page-1"
"owner": {
"name": "Bob",
"email": "[email protected]"
}
}
```

Response Body:

```
{
"_id": "5fa538f82378f23944454737",
"secret": "61e68a4caea667b4a628e45a2ac3dc216e0b8327",
"createdAt": "2020-11-06T11:52:24.449Z",
"owner": {
"gravatar": "21ad0bd836b90d08f4cf640b4c298e7c",
"name": "Bob"
},
...
}
```

### Get Comments

```
GET {{YOUR_API_URL}}/api/comments?pageId={{PAGE_ID}}
```

Response Body:

```
[
{
"_id": "5fa3fa28c5eb4a2475dd0768",
"body": "Hello!",
"createdAt": "2020-11-05T13:12:08.513Z",
"owner": {
"gravatar": "21ad0bd836b90d08f4cf640b4c298e7c",
"name": "Bob"
},
},
...
]
```

### Delete Comment

```
DELETE {{YOUR_API_URL}}/api/comments/{{COMMENT_ID}}?secret={{COMMENT_SECRET}}
```

Response Body:

```
Ok
```

0 comments on commit 150fd36

Please sign in to comment.