chore: update deps

This commit is contained in:
Innei
2021-10-14 17:28:11 +08:00
parent 7fe753c37b
commit 10cb5740bd
6 changed files with 311 additions and 221 deletions

View File

@@ -3,15 +3,12 @@ import { NestFactory } from '@nestjs/core'
import { NestFastifyApplication } from '@nestjs/platform-fastify'
import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger'
import { performance } from 'perf_hooks'
import { API_VERSION, CROSS_DOMAIN } from './app.config'
import { API_VERSION, CROSS_DOMAIN, PORT } from './app.config'
import { AppModule } from './app.module'
import { fastifyApp } from './common/adapters/fastify.adapter'
import { SpiderGuard } from './common/guard/spider.guard'
import { LoggingInterceptor } from './common/interceptors/logging.interceptor'
import { MyLogger } from './processors/logger/logger.service'
const { argv } = require('yargs')
const PORT: number = +argv.port || 2333
const Origin = CROSS_DOMAIN.allowedOrigins
@@ -68,7 +65,7 @@ async function bootstrap() {
SwaggerModule.setup('api-docs', app, document)
}
await app.listen(PORT, '0.0.0.0', async (err, address) => {
await app.listen(+PORT, '0.0.0.0', async (err, address) => {
app.useLogger(app.get(MyLogger))
const url = await app.getUrl()
if (isDev) {

View File

@@ -1,14 +1,10 @@
const yargs = require('yargs')
const isDev = process.env.NODE_ENV === 'development'
const { argv } = require('zx')
Object.defineProperty(exports, '__esModule', { value: true })
/**
* @type {any}
*/
const argv = yargs.argv
console.log(argv)
exports.PORT = argv.port || process.env.PORT || 2333
exports.API_VERSION = 2
exports.CROSS_DOMAIN = {
allowedOrigins: argv.allowed_origins

View File

@@ -80,7 +80,7 @@ export class ImageService {
const {
url: { webUrl },
} = await this.configsService.waitForConfigReady()
const { data } = await this.httpService.axiosRef.get(image, {
const { data } = await this.httpService.axiosRef.get<any>(image, {
responseType: 'arraybuffer',
headers: {
'user-agent':

View File

@@ -1,6 +1,6 @@
import consola_, { FancyReporter, LogLevel } from 'consola'
import { argv } from 'zx'
import { isDev } from './index.util'
const { argv } = require('yargs')
class DateTimeReporter extends FancyReporter {
formatDate(date: Date) {
return date.toLocaleString(undefined, {