refactor: move isProduction variable

This commit is contained in:
amhsirak
2024-12-03 21:09:19 +05:30
parent 36ebff45da
commit 1af752cdcb

View File

@@ -18,6 +18,7 @@ import { fork } from 'child_process';
import { capture } from "./utils/analytics"; import { capture } from "./utils/analytics";
import swaggerUi from 'swagger-ui-express'; import swaggerUi from 'swagger-ui-express';
import swaggerSpec from './swagger/config'; import swaggerSpec from './swagger/config';
const isProduction = process.env.NODE_ENV === 'production';
const app = express(); const app = express();
app.use(cors({ app.use(cors({
@@ -62,7 +63,6 @@ readdirSync(path.join(__dirname, 'api')).forEach((r) => {
} }
}); });
const isProduction = process.env.NODE_ENV === 'production';
const workerPath = path.resolve(__dirname, isProduction ? './worker.js' : './worker.ts'); const workerPath = path.resolve(__dirname, isProduction ? './worker.js' : './worker.ts');
let workerProcess: any; let workerProcess: any;