From 8b8bce0f12abc35e62adf0aa1fda4fe98f49818b Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Tue, 30 Sep 2025 14:27:35 +0200 Subject: [PATCH] fix(cli): fix for detecting pelias/config filename when using the CLI --- config/ServiceConfiguration.js | 2 +- server/http.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config/ServiceConfiguration.js b/config/ServiceConfiguration.js index b1ef199..5b86921 100644 --- a/config/ServiceConfiguration.js +++ b/config/ServiceConfiguration.js @@ -29,7 +29,7 @@ class ServiceConfiguration { // note: you must set `config.pelias=true` to enable this functionality as // it is undesirable at index generation time (for instance). // note: existing `config.filename` value takes precedence over pelias config - if (!_.has(config, 'filename') && _.get(config, 'pelias') === true) { + if (!_.get(config, 'filename') && _.get(config, 'pelias') === true) { const config = peliasConfig.generate().get('services.spatial') if (config && !_.isEmpty(config.datapath) && !_.isEmpty(config.files)) { this.filename = path.resolve(config.datapath, _.first(_.castArray(config.files))) diff --git a/server/http.js b/server/http.js index 40bc39a..5952674 100644 --- a/server/http.js +++ b/server/http.js @@ -24,7 +24,7 @@ const through = require('through2') const handlebars = require('express-handlebars') const helpers = require('handlebars-helpers')() const QueryService = require('../service/QueryService') -const logger = require('pelias-logger').get('geometry') +const logger = require('pelias-logger').get('spatial') const filename = process.argv[2] // select the amount of cpus we will use @@ -68,12 +68,12 @@ app.engine('.hbs', handlebars({ app.set('view engine', '.hbs') // init service -logger.info(`load: ${filename}`) const service = new QueryService({ readonly: true, pelias: true, filename }) +logger.info(`load: ${service.config.filename}`) // store $service on app app.locals.service = service