Browse Source

moved esclient instantiation to function scope

pull/782/head
Stephen Hess 8 years ago
parent
commit
d5d08e8f45
  1. 4
      routes/v1.js

4
routes/v1.js

@ -1,8 +1,5 @@
var Router = require('express').Router; var Router = require('express').Router;
const config = require( 'pelias-config' ).generate();
const esclient = require('elasticsearch').Client(config.esclient);
/** ----------------------- sanitizers ----------------------- **/ /** ----------------------- sanitizers ----------------------- **/
var sanitizers = { var sanitizers = {
autocomplete: require('../sanitizer/autocomplete'), autocomplete: require('../sanitizer/autocomplete'),
@ -63,6 +60,7 @@ var postProc = {
* @param {object} peliasConfig * @param {object} peliasConfig
*/ */
function addRoutes(app, peliasConfig) { function addRoutes(app, peliasConfig) {
const esclient = require('elasticsearch').Client(peliasConfig.esclient);
var base = '/v1/'; var base = '/v1/';

Loading…
Cancel
Save