Browse Source

fix: set default port when environment variable is empty

pull/6157/head
lolgopher 1 year ago
parent
commit
d7b09c3e32
  1. 2
      packages/nocodb/src/gateways/socket.gateway.ts
  2. 2
      packages/nocodb/src/modules/jobs/jobs.gateway.ts

2
packages/nocodb/src/gateways/socket.gateway.ts

@ -14,7 +14,7 @@ function getHash(str) {
return crypto.createHash('md5').update(str).digest('hex'); return crypto.createHash('md5').update(str).digest('hex');
} }
const url = new URL(process.env.NC_PUBLIC_URL || `http://localhost:${process.env.PORT}/`) const url = new URL(process.env.NC_PUBLIC_URL || `http://localhost:${process.env.PORT || '8080'}/`)
@WebSocketGateway({ @WebSocketGateway({
cors: { cors: {
origin: '*', origin: '*',

2
packages/nocodb/src/modules/jobs/jobs.gateway.ts

@ -14,7 +14,7 @@ import { JobEvents } from '../../interface/Jobs';
import type { OnModuleInit } from '@nestjs/common'; import type { OnModuleInit } from '@nestjs/common';
import type { JobStatus } from '../../interface/Jobs'; import type { JobStatus } from '../../interface/Jobs';
const url = new URL(process.env.NC_PUBLIC_URL || `http://localhost:${process.env.PORT}/`) const url = new URL(process.env.NC_PUBLIC_URL || `http://localhost:${process.env.PORT || '8080'}/`)
@WebSocketGateway({ @WebSocketGateway({
cors: { cors: {
origin: '*', origin: '*',

Loading…
Cancel
Save