File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -199,18 +199,8 @@ app.set('view engine', 'ejs')
199199app . use ( require ( './lib/web/baseRouter' ) )
200200app . use ( require ( './lib/web/statusRouter' ) )
201201app . use ( require ( './lib/web/auth' ) )
202+ app . use ( require ( './lib/web/historyRouter' ) )
202203
203- var history = require ( './lib/history.js' )
204- // get history
205- app . get ( '/history' , history . historyGet )
206- // post history
207- app . post ( '/history' , urlencodedParser , history . historyPost )
208- // post history by note id
209- app . post ( '/history/:noteId' , urlencodedParser , history . historyPost )
210- // delete history
211- app . delete ( '/history' , history . historyDelete )
212- // delete history by note id
213- app . delete ( '/history/:noteId' , history . historyDelete )
214204// get me info
215205app . get ( '/me' , function ( req , res ) {
216206 if ( req . isAuthenticated ( ) ) {
Original file line number Diff line number Diff line change 1+ 'use strict'
2+
3+ const Router = require ( 'express' ) . Router
4+
5+ const { urlencodedParser} = require ( './utils' )
6+ const history = require ( '../history.js' )
7+
8+ const historyRouter = module . exports = Router ( )
9+
10+ // get history
11+ historyRouter . get ( '/history' , history . historyGet )
12+ // post history
13+ historyRouter . post ( '/history' , urlencodedParser , history . historyPost )
14+ // post history by note id
15+ historyRouter . post ( '/history/:noteId' , urlencodedParser , history . historyPost )
16+ // delete history
17+ historyRouter . delete ( '/history' , history . historyDelete )
18+ // delete history by note id
19+ historyRouter . delete ( '/history/:noteId' , history . historyDelete )
You can’t perform that action at this time.
0 commit comments