Convert first files to TypeScript

Signed-off-by: David Mehren <dmehren1@gmail.com>
This commit is contained in:
David Mehren 2019-11-23 21:34:31 +01:00 committed by Sheogorath
parent 0d788e0aec
commit f6eec0ce90
No known key found for this signature in database
GPG key ID: C9B1C80737B9CE18
7 changed files with 301 additions and 294 deletions

27
lib/web/note/router.ts Normal file
View file

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