Skip to content

Commit

Permalink
refactor: update config
Browse files Browse the repository at this point in the history
  • Loading branch information
kuizuo committed Dec 1, 2023
1 parent faee140 commit c63f12c
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 21 deletions.
3 changes: 1 addition & 2 deletions apps/api/.env
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# app
APP_NAME = Nest Admin
APP_PORT = 5001
APP_BASE_URL = http://localhost:5001
APP_LOCALE = zh-CN
WS_PORT = 5002
WS_PATH = ws-api

# logger
LOGGER_LEVEL = verbose
Expand Down
3 changes: 2 additions & 1 deletion apps/api/src/config/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import { env, envNumber } from '~/global/env'
export const AppConfig = registerAs('app', () => ({
name: env('APP_NAME'),
port: envNumber('APP_PORT', 3000),
globalPrefix: env('GLOBAL_PREFIX'),
baseUrl: env('APP_BASE_URL'),
globalPrefix: env('GLOBAL_PREFIX', 'api'),
locale: env('APP_LOCALE', 'zh-CN'),

logger: {
Expand Down
1 change: 0 additions & 1 deletion apps/api/src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@ export * from './database.config'
export * from './swagger.config'
export * from './security.config'
export * from './mailer.config'
export * from './sms.config'
13 changes: 0 additions & 13 deletions apps/api/src/config/sms.config.ts

This file was deleted.

6 changes: 2 additions & 4 deletions apps/api/src/shared/helper/cron.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,10 @@ import { AccessTokenEntity } from '~/modules/auth/entities/access-token.entity'

@Injectable()
export class CronService {
private logger: Logger
private logger: Logger = new Logger(CronService.name)
constructor(
private readonly configService: ConfigService,
) {
this.logger = new Logger(CronService.name)
}
) {}

@CronOnce(CronExpression.EVERY_DAY_AT_MIDNIGHT)
async deleteExpiredJWT() {
Expand Down

0 comments on commit c63f12c

Please sign in to comment.