summaryrefslogtreecommitdiff
path: root/lib/web/note/router.js
blob: cf6fdf4314946cd7f9146048fe82741a5cb9717a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
'use strict'

const Router = require('express').Router
const { markdownParser } = require('../utils')

const router = module.exports = Router()

const noteController = require('./controller')
const slide = require('./slide')

// get new note
router.get('/new', noteController.createFromPOST)
// post new note with content
router.post('/new', markdownParser, noteController.createFromPOST)
// post new note with content and alias
router.post('/new/:noteId', markdownParser, noteController.createFromPOST)
// get publish note
router.get('/s/:shortid', noteController.showPublishNote)
// publish note actions
router.get('/s/:shortid/:action', noteController.publishNoteActions)
// get publish slide
router.get('/p/:shortid', slide.showPublishSlide)
// publish slide actions
router.get('/p/:shortid/:action', slide.publishSlideActions)
// get note by id
router.get('/:noteId', noteController.showNote)
// note actions
router.get('/:noteId/:action', noteController.doAction)
// note actions with action id
router.get('/:noteId/:action/:actionId', noteController.doAction)