fixed lib/web/note/router.ts

Signed-off-by: Philip Molares <philip.molares@udo.edu>
Signed-off-by: David Mehren <dmehren1@gmail.com>
This commit is contained in:
Philip Molares 2020-04-12 20:55:17 +02:00 committed by David Mehren
parent 46774282cc
commit 3b36e2e0e6
No known key found for this signature in database
GPG key ID: 6017AF117F9756CB

View file

@ -1,27 +1,29 @@
import {markdownParser} from "../utils";
import { markdownParser } from '../utils'
import {SlideController} from "./slide";
import {NoteController} from "./controller";
import {Router} from "express";
import { SlideController } from './slide'
import { NoteController } from './controller'
import { Router } from 'express'
const router = module.exports = Router();
const NoteRouter = Router()
// get new note
router.get('/new', NoteController.createFromPOST);
NoteRouter.get('/new', NoteController.createFromPOST)
// post new note with content
router.post('/new', markdownParser, NoteController.createFromPOST);
NoteRouter.post('/new', markdownParser, NoteController.createFromPOST)
// post new note with content and alias
router.post('/new/:noteId', markdownParser, NoteController.createFromPOST);
NoteRouter.post('/new/:noteId', markdownParser, NoteController.createFromPOST)
// get publish note
router.get('/s/:shortid', NoteController.showPublishNote);
NoteRouter.get('/s/:shortid', NoteController.showPublishNote)
// publish note actions
router.get('/s/:shortid/:action', NoteController.publishNoteActions);
NoteRouter.get('/s/:shortid/:action', NoteController.publishNoteActions)
// get publish slide
router.get('/p/:shortid', SlideController.showPublishSlide);
NoteRouter.get('/p/:shortid', SlideController.showPublishSlide)
// publish slide actions
router.get('/p/:shortid/:action', SlideController.publishSlideActions);
NoteRouter.get('/p/:shortid/:action', SlideController.publishSlideActions)
// get note by id
router.get('/:noteId', NoteController.showNote);
NoteRouter.get('/:noteId', NoteController.showNote)
// note actions
router.get('/:noteId/:action', NoteController.doAction);
NoteRouter.get('/:noteId/:action', NoteController.doAction)
// note actions with action id
router.get('/:noteId/:action/:actionId', NoteController.doAction);
NoteRouter.get('/:noteId/:action/:actionId', NoteController.doAction)
export { NoteRouter }