hedgedoc/lib/web/note/router.ts
Sheogorath 37923d11f8
Rewrite slide controller to TypeScript
Before this patch the non-TypeScript version of the slide mode causes
problems with the TypeScript code. Therefore, in order to get things
working, this patch does minimalistic changes to the slide mode
controller to bring it into TypeScript convention. And unbreak slide
mode. Further changes are required, but this gets slide mode back to a
usable state.

Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2020-02-26 15:05:51 +01:00

27 lines
1 KiB
TypeScript

import {markdownParser} from "../utils";
import {SlideController} from "./slide";
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
router.get('/p/:shortid', SlideController.showPublishSlide);
// publish slide actions
router.get('/p/:shortid/:action', SlideController.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);