2020-04-25 14:58:38 -04:00
|
|
|
import { Router } from 'express'
|
2020-04-12 14:55:17 -04:00
|
|
|
import { markdownParser } from '../utils'
|
2020-04-25 14:58:38 -04:00
|
|
|
import * as NoteController from './controller'
|
2019-11-23 15:34:31 -05:00
|
|
|
|
2020-04-25 14:58:38 -04:00
|
|
|
import * as SlideController from './slide'
|
2019-11-23 15:34:31 -05:00
|
|
|
|
2020-04-12 14:55:17 -04:00
|
|
|
const NoteRouter = Router()
|
2019-11-23 15:34:31 -05:00
|
|
|
// get new note
|
2020-04-12 14:55:17 -04:00
|
|
|
NoteRouter.get('/new', NoteController.createFromPOST)
|
2019-11-23 15:34:31 -05:00
|
|
|
// post new note with content
|
2020-04-12 14:55:17 -04:00
|
|
|
NoteRouter.post('/new', markdownParser, NoteController.createFromPOST)
|
2019-11-23 15:34:31 -05:00
|
|
|
// post new note with content and alias
|
2020-04-12 14:55:17 -04:00
|
|
|
NoteRouter.post('/new/:noteId', markdownParser, NoteController.createFromPOST)
|
2019-11-23 15:34:31 -05:00
|
|
|
// get publish note
|
2020-04-12 14:55:17 -04:00
|
|
|
NoteRouter.get('/s/:shortid', NoteController.showPublishNote)
|
2019-11-23 15:34:31 -05:00
|
|
|
// publish note actions
|
2020-04-12 14:55:17 -04:00
|
|
|
NoteRouter.get('/s/:shortid/:action', NoteController.publishNoteActions)
|
2019-11-23 15:34:31 -05:00
|
|
|
// get publish slide
|
2020-04-12 14:55:17 -04:00
|
|
|
NoteRouter.get('/p/:shortid', SlideController.showPublishSlide)
|
2019-11-23 15:34:31 -05:00
|
|
|
// publish slide actions
|
2020-04-12 14:55:17 -04:00
|
|
|
NoteRouter.get('/p/:shortid/:action', SlideController.publishSlideActions)
|
2019-11-23 15:34:31 -05:00
|
|
|
// get note by id
|
2020-04-12 14:55:17 -04:00
|
|
|
NoteRouter.get('/:noteId', NoteController.showNote)
|
2019-11-23 15:34:31 -05:00
|
|
|
// note actions
|
2020-04-12 14:55:17 -04:00
|
|
|
NoteRouter.get('/:noteId/:action', NoteController.doAction)
|
2019-11-23 15:34:31 -05:00
|
|
|
// note actions with action id
|
2020-04-12 14:55:17 -04:00
|
|
|
NoteRouter.get('/:noteId/:action/:actionId', NoteController.doAction)
|
|
|
|
|
|
|
|
export { NoteRouter }
|