summaryrefslogtreecommitdiff
path: root/lib/web
diff options
context:
space:
mode:
authorBoHong Li2017-04-12 05:56:20 +0800
committerRaccoon Li2017-05-08 19:24:38 +0800
commit689bade73046ba2c35af59d7a65824a441b14a65 (patch)
tree9d2397d1f8c6ce73c9ee9d81ce7f1f2508557a03 /lib/web
parente2ac73f5a36310dead9e23f46004ccef909f317b (diff)
refactor(app.js): Extract note action
Diffstat (limited to '')
-rw-r--r--lib/web/noteRouter.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/web/noteRouter.js b/lib/web/noteRouter.js
new file mode 100644
index 00000000..007c02c2
--- /dev/null
+++ b/lib/web/noteRouter.js
@@ -0,0 +1,24 @@
+'use strict'
+
+const Router = require('express').Router
+
+const response = require('../response')
+
+const noteRouter = module.exports = Router()
+
+// get new note
+noteRouter.get('/new', response.newNote)
+// get publish note
+noteRouter.get('/s/:shortid', response.showPublishNote)
+// publish note actions
+noteRouter.get('/s/:shortid/:action', response.publishNoteActions)
+// get publish slide
+noteRouter.get('/p/:shortid', response.showPublishSlide)
+// publish slide actions
+noteRouter.get('/p/:shortid/:action', response.publishSlideActions)
+// get note by id
+noteRouter.get('/:noteId', response.showNote)
+// note actions
+noteRouter.get('/:noteId/:action', response.noteActions)
+// note actions with action id
+noteRouter.get('/:noteId/:action/:actionId', response.noteActions)