Migrate historyRouter.js and baseRouter.js to TypeScript

Signed-off-by: David Mehren <dmehren1@gmail.com>
This commit is contained in:
David Mehren 2020-04-12 17:39:35 +02:00
parent 0ca8e2dc7d
commit d44144630f
No known key found for this signature in database
GPG key ID: 6017AF117F9756CB
3 changed files with 18 additions and 24 deletions

16
lib/web/historyRouter.ts Normal file
View file

@ -0,0 +1,16 @@
import { urlencodedParser } from './utils'
import { History } from '../history'
const Router = require('express').Router
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)