Added DELETE route

This commit is contained in:
2021-01-30 12:30:37 +11:00
parent adb91947d7
commit d24c16c5ad
3 changed files with 63 additions and 4 deletions
+17 -4
View File
@@ -57,28 +57,41 @@ POST /news
"body": body //body of the article
}
//result
//result:
{
"ok": ok //true on success, otherwise false
"index": index //new index of the article, or undefined
"error": error //error encountered, or undefined
}
//similar to `/news/publish`, but allows overwriting an existing post
//similar to `/news/publish`, but allows overwriting an existing article
PATCH /news/:id
//arguments:
{
"key": key //the whitelist key, allows access to the POST routes
"key": key //the whitelist key, allows access to the PATCH routes
"title": title //title of the article
"author": author //author of the article
"body": body //body of the article
}
//result
//result:
{
"ok": ok //true on success, otherwise false
"error": error //error encountered, or undefined
}
//remove an article from the news feed
DELETE /news/:id
//arguments:
{
"key": key //the whitelist key, allows access to the DELETE routes
}
//result:
{
"ok": ok //true on success, otherwise false
"error": error //error encountered, or undefined
}
```