summaryrefslogtreecommitdiff
path: root/bucky/app/api.js
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2017-12-22 07:11:26 +0100
committerJules Laplace <julescarbon@gmail.com>2017-12-22 07:11:26 +0100
commitfa4ed0f3b1ce5decfc6ee59d38e63e78a7793de4 (patch)
tree74658c754cbdff432aa8dc8b4f3521c993993c45 /bucky/app/api.js
parent1a67f6f262364ee4fed0c1538ef2f41d772bf1b1 (diff)
new keyword form
Diffstat (limited to 'bucky/app/api.js')
-rw-r--r--bucky/app/api.js23
1 files changed, 15 insertions, 8 deletions
diff --git a/bucky/app/api.js b/bucky/app/api.js
index ff17626..63e480e 100644
--- a/bucky/app/api.js
+++ b/bucky/app/api.js
@@ -41,7 +41,7 @@ function route (app){
/* threads */
-
+
app.get("/api/index",
bucky.ensureLastlog,
middleware.ensureAuthenticated,
@@ -59,6 +59,13 @@ function route (app){
lastlog: res.lastlog,
})
})
+ app.post("/api/keyword/new",
+ bucky.ensureLastlog,
+ middleware.ensureAuthenticated,
+ bucky.createKeyword,
+ function(req, res){
+ res.json({ keyword: res.keyword })
+ })
app.get("/api/keyword/:keyword",
bucky.ensureLastlog,
middleware.ensureAuthenticated,
@@ -123,10 +130,10 @@ function route (app){
function(req, res){
res.send({ status: 'ok' })
})
-
+
/* comments */
- // one endpoint handles comments + files
+ // one endpoint handles comments + files
app.post("/api/thread/:id/comment",
middleware.ensureAuthenticated,
bucky.ensureThread,
@@ -178,7 +185,7 @@ function route (app){
})
/* search */
-
+
app.get("/api/search",
middleware.ensureAuthenticated,
search.search,
@@ -190,7 +197,7 @@ function route (app){
)
/* keywords */
-
+
app.get("/api/keywords",
middleware.ensureAuthenticated,
bucky.ensureKeywords,
@@ -223,10 +230,10 @@ function route (app){
threads: res.threads,
})
})
-
-
+
+
/* mail */
-
+
app.get("/api/mailbox/:box",
middleware.ensureAuthenticated,
bucky.ensureMailboxes,