mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-23 10:16:32 -05:00
Migrate historyRouter.js and baseRouter.js to TypeScript
Signed-off-by: David Mehren <dmehren1@gmail.com>
This commit is contained in:
parent
0ca8e2dc7d
commit
d44144630f
3 changed files with 18 additions and 24 deletions
|
@ -1,13 +1,9 @@
|
|||
'use strict'
|
||||
import { response } from '../response'
|
||||
import { errors } from '../errors'
|
||||
|
||||
const Router = require('express').Router
|
||||
|
||||
const response = require('../response')
|
||||
|
||||
const baseRouter = module.exports = Router()
|
||||
|
||||
const errors = require('../errors')
|
||||
|
||||
// get index
|
||||
baseRouter.get('/', response.showIndex)
|
||||
// get 403 forbidden
|
|
@ -1,18 +0,0 @@
|
|||
'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)
|
16
lib/web/historyRouter.ts
Normal file
16
lib/web/historyRouter.ts
Normal 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)
|
Loading…
Reference in a new issue