Files
remark42/backend/remark.rest
T
UmputunandGitHub de013c7d5a feature/mongo (#165)
* WIP: start mongo engine

* WIP: mongo accessor and admin

* integrate mongo store to main

* disable mongo tests by default, only in CI

* connection with constructor

* add mongo buffered writer

* buffered mongo writer

* fix nil responses on an empty list from mongo

* missing mongo index for scores

* cancelable store

* add gridfs implementation of avatar store

* fix race on mongo session copy

* gridfs avatars without tmp files

* move avatar store

* minor comments and refactoring for avatar store

* merged from current master

* simplify gridfs reader

* lint: fix minor warns

* test mongo against env defined url

* pass MONGO_REMARK_TEST to docker and travis

* set dockerfile env for mongo test url

* increase connect timeout in mongo tests

* pass MONGO_REMARK_TEST to drone build

* add MONGO_REMARK_TEST to branch stage of drone

* mass mongo test url via build_args_from_env

* populate mongo IP to docker build hosts

* test env

* pass mongo ip via .mongo

* remove .mongo temp from git

* add .mongo -> env to linter step

* allow more time to autoflush writer test

* default mongo tests to "mongo" if not in env

* merge fresh master into

* add test for mongo cleanup

* msg for a failed test

* lazy fix for failed test

* add an ability to skip all mongo tests

* add backend dev instructions

* remove unused code from mongo server

* move mongo testing to connection_test

* restore testing.go

* lint: minor warns for testing code
2018-07-13 12:27:11 -05:00

121 lines
2.9 KiB
ReStructuredText

### find request with tree
GET {{host}}/api/v1/find?site={{site}}&sort=-active&format=tree&url={{url}}
### find request with plain
GET {{host}}/api/v1/find?site={{site}}&sort=-time&format=plain&url={{url}}
### last 50 comments
GET {{host}}/api/v1/last/50?site={{site}}
### create comment
POST {{host}}/api/v1/comment
Content-Type: application/json
{
"text": "comment *blah* http://radio-t.com",
"locator": {
"url": "{{url}}",
"site": "{{site}}"
}
}
### create comment with image
POST {{host}}/api/v1/comment
Content-Type: application/json
{
"text": "comment *blah* http://radio-t.com <img src=\"http://minionomaniya.ru/wp-content/uploads/2016/01/Кевин.jpg\">",
"locator": {
"url": "{{url}}",
"site": "{{site}}"
}
}
### preview comment
POST {{host}}/api/v1/preview
Content-Type: application/json
{
"text": "comment *blah* http://radio-t.com"
}
### update comment
PUT {{host}}/api/v1/comment/7b88d7a91353ab206cb63cdca18fb26bcb30205b?site=remark&url=https://radio-t.com/blah1
Content-Type: application/json
{
"text": "edit comment blah http://radio-t.com 12345",
"summary": "fix blah"
}
### pin comment
PUT {{host}}/api/v1/admin/pin/3665976683?site=remark&url={{url}}&pin=1
### vote for comment
PUT {{host}}/api/v1/vote/3665976683?site=remark&url={{url}}&vote=1
### get user info
GET {{host}}/api/v1/user
### get comment by id
GET {{host}}/api/v1/id/3665976683?site=remark&url={{url}}
### get comment by id 2
GET {{host}}/api/v1/id/a2ddb8d2f65008ee1a1e3af8df0f26beb042309c?site=remark&url=https://radio-t.com/blah1
### get comment by user id
GET {{host}}/api/v1/comments?site={{site}}&user=github_f1fda731dd18fbb388c943599fcae5a213315add&limit=5
### get comment by user id2
GET {{host}}/api/v1/comments?site={{site}}&user=github_0a4349d868946d7841424c9bdd4415629df771e6
### get count
GET {{host}}/api/v1/count?site={{site}}&url={{url}}
### get counts for many
POST {{host}}/api/v1/counts?site={{site}}
Content-Type: application/json
[
"https://radio-t.com/p/2017/12/02/podcast-574/",
"https://radio-t.com/p/2017/12/09/podcast-575/",
"{{url}}"
]
### list commented posts
GET {{host}}/api/v1/list?site={{site}}&limit=10&skip=5
### get config
GET {{host}}/api/v1/config
### block user
PUT {{host}}/api/v1/admin/user/disqus_grigorybakunov?site={{site}}&block=1
### unblock user
PUT {{host}}/api/v1/admin/user/disqus_grigorybakunov?site={{site}}&block=0
### list blocked user
GET {{host}}/api/v1/admin/blocked?site={{site}}
### delete comment by id
DELETE {{host}}/api/v1/admin/comment/3665976683?site={{site}}&url={{url}}
### get post info
GET {{host}}/api/v1/info?site={{site}}&url=https://radio-t.com/p/2018/05/08/prep-597/
### post rss
GET {{host}}/api/v1/rss/post?site={{site}}&url={{url}}
### site rss
GET {{host}}/api/v1/rss/site?site={{site}}
### get default avatar
GET {{host}}/api/v1/avatar/blah
### get config
GET {{host}}/api/v1/config?site={{site}}
### ping
GET {{host}}/ping