|
|
@ -1,6 +1,7 @@ |
|
|
|
var check = require('check-types'), |
|
|
|
var check = require('check-types'), |
|
|
|
es = require('elasticsearch'), |
|
|
|
es = require('elasticsearch'), |
|
|
|
exceptions = require('elasticsearch-exceptions/lib/exceptions/SupportedExceptions'); |
|
|
|
exceptions = require('elasticsearch-exceptions/lib/exceptions/SupportedExceptions'); |
|
|
|
|
|
|
|
const logger = require('pelias-logger').get('api'); |
|
|
|
|
|
|
|
|
|
|
|
// create a list of regular expressions to match against.
|
|
|
|
// create a list of regular expressions to match against.
|
|
|
|
// note: list created when the server starts up; for performance reasons.
|
|
|
|
// note: list created when the server starts up; for performance reasons.
|
|
|
@ -60,6 +61,8 @@ function sendJSONResponse(req, res, next) { |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
logger.info('status code', statusCode); |
|
|
|
|
|
|
|
|
|
|
|
// respond
|
|
|
|
// respond
|
|
|
|
return res.status(statusCode).json(res.body); |
|
|
|
return res.status(statusCode).json(res.body); |
|
|
|
} |
|
|
|
} |
|
|
|