codimd/lib/web/historyRouter.js

19 lines
614 B
JavaScript
Raw Normal View History

2017-04-11 21:48:55 +00:00
'use strict'
const Router = require('express').Router
const { urlencodedParser } = require('./utils')
const history = require('../history')
2017-04-11 21:48:55 +00:00
const historyRouter = module.exports = Router()
// get history
historyRouter.get('/history', history.historyGet)
// post history
historyRouter.post('/history', urlencodedParser, history.historyPost)
// post history by note id
historyRouter.post('/history/:noteId', urlencodedParser, history.historyPost)
// delete history
historyRouter.delete('/history', history.historyDelete)
// delete history by note id
historyRouter.delete('/history/:noteId', history.historyDelete)