2019-11-23 15:34:31 -05:00
|
|
|
import {markdownParser} from "../utils";
|
|
|
|
|
2020-02-26 08:21:00 -05:00
|
|
|
import {SlideController} from "./slide";
|
2019-11-23 15:34:31 -05:00
|
|
|
import {NoteController} from "./controller";
|
|
|
|
import {Router} from "express";
|
|
|
|
|
|
|
|
const router = module.exports = Router();
|
|
|
|
// 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
|
2020-02-26 08:21:00 -05:00
|
|
|
router.get('/p/:shortid', SlideController.showPublishSlide);
|
2019-11-23 15:34:31 -05:00
|
|
|
// publish slide actions
|
2020-02-26 08:21:00 -05:00
|
|
|
router.get('/p/:shortid/:action', SlideController.publishSlideActions);
|
2019-11-23 15:34:31 -05:00
|
|
|
// 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);
|