2019-10-27 08:51:53 -04:00
|
|
|
'use strict'
|
|
|
|
|
|
|
|
const Router = require('express').Router
|
|
|
|
const { markdownParser } = require('../utils')
|
|
|
|
|
|
|
|
const router = module.exports = Router()
|
|
|
|
|
2019-10-27 09:40:36 -04:00
|
|
|
const noteController = require('./controller')
|
2019-10-27 09:27:15 -04:00
|
|
|
const slide = require('./slide')
|
2019-10-27 08:51:53 -04:00
|
|
|
|
|
|
|
// get new note
|
2019-10-27 09:40:36 -04:00
|
|
|
router.get('/new', noteController.createFromPOST)
|
2019-10-27 08:51:53 -04:00
|
|
|
// post new note with content
|
2019-10-27 09:40:36 -04:00
|
|
|
router.post('/new', markdownParser, noteController.createFromPOST)
|
2019-10-27 08:51:53 -04:00
|
|
|
// post new note with content and alias
|
2019-10-27 09:40:36 -04:00
|
|
|
router.post('/new/:noteId', markdownParser, noteController.createFromPOST)
|
2019-10-27 08:51:53 -04:00
|
|
|
// get publish note
|
2019-10-27 10:22:14 -04:00
|
|
|
router.get('/s/:shortid', noteController.showPublishNote)
|
2019-10-27 08:51:53 -04:00
|
|
|
// publish note actions
|
2019-10-27 10:22:14 -04:00
|
|
|
router.get('/s/:shortid/:action', noteController.publishNoteActions)
|
2019-10-27 08:51:53 -04:00
|
|
|
// get publish slide
|
2019-10-27 09:27:15 -04:00
|
|
|
router.get('/p/:shortid', slide.showPublishSlide)
|
2019-10-27 08:51:53 -04:00
|
|
|
// publish slide actions
|
2019-10-27 09:27:15 -04:00
|
|
|
router.get('/p/:shortid/:action', slide.publishSlideActions)
|
2019-10-27 08:51:53 -04:00
|
|
|
// get note by id
|
2019-10-27 09:59:44 -04:00
|
|
|
router.get('/:noteId', noteController.showNote)
|
2019-10-27 08:51:53 -04:00
|
|
|
// note actions
|
2019-10-27 09:40:36 -04:00
|
|
|
router.get('/:noteId/:action', noteController.doAction)
|
2019-10-27 08:51:53 -04:00
|
|
|
// note actions with action id
|
2019-10-27 09:40:36 -04:00
|
|
|
router.get('/:noteId/:action/:actionId', noteController.doAction)
|