|
|
@ -37,24 +37,18 @@ app.get( '/', controllers.index() ); |
|
|
|
// doc API
|
|
|
|
// doc API
|
|
|
|
app.get( '/doc', sanitisers.doc.middleware, controllers.doc() ); |
|
|
|
app.get( '/doc', sanitisers.doc.middleware, controllers.doc() ); |
|
|
|
|
|
|
|
|
|
|
|
// suggest API
|
|
|
|
// suggest APIs
|
|
|
|
app.get( '/suggest', sanitisers.suggest.middleware, controllers.suggest() ); |
|
|
|
app.get( '/suggest', sanitisers.search.middleware, controllers.search() ); |
|
|
|
app.get( '/suggest/nearby',
|
|
|
|
app.get( '/suggest/nearby', sanitisers.suggest.middleware, controllers.search() ); |
|
|
|
sanitisers.suggest.middleware,
|
|
|
|
app.get( '/suggest/coarse', sanitisers.coarse.middleware, controllers.search() ); |
|
|
|
controllers.suggest(undefined, undefined, require('./helper/queryMixer').suggest_nearby) ); |
|
|
|
|
|
|
|
app.get( '/suggest/coarse',
|
|
|
|
// search APIs
|
|
|
|
sanitisers.coarse.middleware,
|
|
|
|
|
|
|
|
controllers.suggest(undefined, undefined, require('./helper/queryMixer').coarse) ); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// search API
|
|
|
|
|
|
|
|
app.get( '/search', sanitisers.search.middleware, controllers.search() ); |
|
|
|
app.get( '/search', sanitisers.search.middleware, controllers.search() ); |
|
|
|
|
|
|
|
app.get( '/search/coarse', sanitisers.coarse.middleware, controllers.search() ); |
|
|
|
|
|
|
|
|
|
|
|
// reverse API
|
|
|
|
// reverse API
|
|
|
|
app.get( '/reverse', sanitisers.reverse.middleware, controllers.search(undefined, require('./query/reverse')) ); |
|
|
|
app.get( '/reverse', sanitisers.reverse.middleware, controllers.search(undefined, require('./query/reverse')) ); |
|
|
|
|
|
|
|
|
|
|
|
// coarse API
|
|
|
|
|
|
|
|
app.get( '/search/coarse', sanitisers.coarse.middleware, controllers.search() ); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** ----------------------- error middleware ----------------------- **/ |
|
|
|
/** ----------------------- error middleware ----------------------- **/ |
|
|
|
|
|
|
|
|
|
|
|
app.use( require('./middleware/404') ); |
|
|
|
app.use( require('./middleware/404') ); |
|
|
|