2017-04-11 21:56:20 +00:00
|
|
|
'use strict'
|
|
|
|
|
|
|
|
const Router = require('express').Router
|
|
|
|
|
|
|
|
const response = require('../response')
|
|
|
|
|
2019-04-12 09:57:32 +00:00
|
|
|
const { markdownParser } = require('./utils')
|
2018-01-10 23:51:22 +00:00
|
|
|
|
2017-04-11 21:56:20 +00:00
|
|
|
const noteRouter = module.exports = Router()
|
|
|
|
|
|
|
|
// get new note
|
|
|
|
noteRouter.get('/new', response.newNote)
|
2018-01-10 23:51:22 +00:00
|
|
|
// post new note with content
|
|
|
|
noteRouter.post('/new', markdownParser, response.newNote)
|
2017-04-11 21:56:20 +00:00
|
|
|
// 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)
|