Browse Source

Add /status controller

It's at the root level, and simply returns 200 with 'status: ok' as the
body.
pull/246/head
Julian Simioni 9 years ago
parent
commit
5d7f7ee4c0
  1. 3
      controller/status.js
  2. 8
      routes/v1.js

3
controller/status.js

@ -0,0 +1,3 @@
module.exports = function controller( req, res, next) {
res.send('status: ok');
};

8
routes/v1.js

@ -19,7 +19,8 @@ var middleware = {
var controllers = {
mdToHTML: require('../controller/markdownToHtml'),
place: require('../controller/place'),
search: require('../controller/search')
search: require('../controller/search'),
status: require('../controller/status')
};
/** ----------------------- controllers ----------------------- **/
@ -82,6 +83,9 @@ function addRoutes(app, peliasConfig) {
postProc.renamePlacenames(),
postProc.geocodeJSON(peliasConfig),
postProc.sendJSON
]),
status: createRouter([
controllers.status
])
};
@ -96,6 +100,8 @@ function addRoutes(app, peliasConfig) {
app.get ( base + 'search', routers.search );
app.post( base + 'search', routers.search );
app.get ( base + 'reverse', routers.reverse );
app.get ( '/status', routers.status );
}
/**

Loading…
Cancel
Save