summaryrefslogtreecommitdiff
path: root/lib/web/historyRouter.js
blob: fa426bbb18c0326949d79f97f4ed7f3ea57bf7ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
'use strict'

const Router = require('express').Router

const { urlencodedParser } = require('./utils')
const history = require('../history')
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)