mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-21 09:03:02 +00:00
Resolve "Transition to ESLint"
This commit is contained in:
committed by
Rainer Killinger
parent
ca1d2444e0
commit
418ba67d15
@@ -24,9 +24,9 @@ type UserOptions = Parameters<typeof expressPrometheusMiddleware>[0];
|
||||
* Create and configure a new Express Prometheus Middleware instance
|
||||
*
|
||||
* This function tries to configure the new instance with JSON read from
|
||||
* `./conf/prometheus.json`. When this fails an instance configured with
|
||||
* `./conf/prometheus.json`. When this fails an instance configured with
|
||||
* default options is returned.
|
||||
*
|
||||
*
|
||||
* @returns express.Express
|
||||
*/
|
||||
export function getPrometheusMiddleware(): express.Express {
|
||||
@@ -34,9 +34,9 @@ export function getPrometheusMiddleware(): express.Express {
|
||||
let options: UserOptions = {};
|
||||
|
||||
try {
|
||||
options = JSON.parse(fs.readFileSync(configFileName, 'utf-8'));
|
||||
} catch(err) {
|
||||
Logger.warn('Could not get options for Prometheus Middleware.', err);
|
||||
options = JSON.parse(fs.readFileSync(configFileName, 'utf8'));
|
||||
} catch (error) {
|
||||
Logger.warn('Could not get options for Prometheus Middleware.', error);
|
||||
}
|
||||
|
||||
return expressPrometheusMiddleware(options);
|
||||
|
||||
Reference in New Issue
Block a user