This commit is contained in:
xiaojunnuo
2024-11-01 00:59:09 +08:00
parent b817cb4a1b
commit 0165ccbaac
17 changed files with 131 additions and 47 deletions
@@ -0,0 +1,23 @@
import { Controller, Get, Provide } from '@midwayjs/core';
import { BaseController, Constants } from '@certd/lib-server';
import { http, logger } from '@certd/pipeline';
/**
*/
@Provide()
@Controller('/api/app/')
export class AppController extends BaseController {
@Get('/latest', { summary: Constants.per.authOnly })
async latest(): Promise<any> {
const res = await http.request({
url: 'https://registry.npmmirror.com/@certd/pipeline',
method: 'get',
});
try {
const latest = res['dist-tags'].latest;
return this.ok(latest);
} catch (e: any) {
logger.error(e);
return this.ok('');
}
}
}
@@ -1,5 +1,4 @@
import { MidwayEnvironmentService } from '@midwayjs/core';
import { Controller, Get, Inject, Provide } from '@midwayjs/core';
import { Controller, Get, Inject, MidwayEnvironmentService, Provide } from '@midwayjs/core';
import { logger } from '@certd/pipeline';
import { Constants } from '@certd/lib-server';