Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { inject, get, controller, provide, priority } from 'midway-web';
import {MetricsUtils} from '../util/metricsUtils';
import {MetricNameJSON} from '../../interface/services/common';
@priority(0)
@provide()
@controller('/v2/api/metrics/')
export class MetricsCtrl {
@inject('metricsService')
private metricsService;
@get('/getMetricsNames')
async getMetricsNames(ctx) {
const query = ctx.query;
const {scope, scopeName, env} = query;
const data = await this.metricsService.getMetricsNames({
scope, scopeName, env,
});
ctx.body = {
success: true,
data,