|
|
@ -15,7 +15,7 @@ app.use( require('./middleware/jsonp') ); |
|
|
|
/** ----------------------- sanitisers ----------------------- **/ |
|
|
|
/** ----------------------- sanitisers ----------------------- **/ |
|
|
|
|
|
|
|
|
|
|
|
var sanitisers = {}; |
|
|
|
var sanitisers = {}; |
|
|
|
sanitisers.doc = require('./sanitiser/doc'); |
|
|
|
sanitisers.place = require('./sanitiser/place'); |
|
|
|
sanitisers.suggest = require('./sanitiser/suggest'); |
|
|
|
sanitisers.suggest = require('./sanitiser/suggest'); |
|
|
|
sanitisers.search = require('./sanitiser/search'); |
|
|
|
sanitisers.search = require('./sanitiser/search'); |
|
|
|
sanitisers.coarse = require('./sanitiser/coarse'); |
|
|
|
sanitisers.coarse = require('./sanitiser/coarse'); |
|
|
@ -25,7 +25,7 @@ sanitisers.reverse = require('./sanitiser/reverse'); |
|
|
|
|
|
|
|
|
|
|
|
var controllers = {}; |
|
|
|
var controllers = {}; |
|
|
|
controllers.index = require('./controller/index'); |
|
|
|
controllers.index = require('./controller/index'); |
|
|
|
controllers.doc = require('./controller/doc'); |
|
|
|
controllers.place = require('./controller/place'); |
|
|
|
controllers.search = require('./controller/search'); |
|
|
|
controllers.search = require('./controller/search'); |
|
|
|
|
|
|
|
|
|
|
|
/** ----------------------- routes ----------------------- **/ |
|
|
|
/** ----------------------- routes ----------------------- **/ |
|
|
@ -33,8 +33,8 @@ controllers.search = require('./controller/search'); |
|
|
|
// api root
|
|
|
|
// api root
|
|
|
|
app.get( '/', controllers.index() ); |
|
|
|
app.get( '/', controllers.index() ); |
|
|
|
|
|
|
|
|
|
|
|
// doc API
|
|
|
|
// place API
|
|
|
|
app.get( '/doc', sanitisers.doc.middleware, controllers.doc() ); |
|
|
|
app.get( '/place', sanitisers.place.middleware, controllers.place() ); |
|
|
|
|
|
|
|
|
|
|
|
// suggest APIs
|
|
|
|
// suggest APIs
|
|
|
|
app.get( '/suggest', sanitisers.search.middleware, controllers.search() ); |
|
|
|
app.get( '/suggest', sanitisers.search.middleware, controllers.search() ); |
|
|
|