Skip to content

Commit

Permalink
fix: fix sview issue
Browse files Browse the repository at this point in the history
Fix path and socket io issue
  • Loading branch information
ckng0221 committed Dec 27, 2023
1 parent a96f506 commit 50eca3f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion apps/view/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { ViewModule } from './view.module';
async function bootstrap() {
const app = await NestFactory.create(ViewModule);

const PORT = process.env.PORT
const PORT = process.env.PORT;
await app.listen(PORT);
}
bootstrap();
5 changes: 3 additions & 2 deletions apps/view/src/view.module.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { Module } from '@nestjs/common';
import { ConfigModule } from '@nestjs/config';
import { ServeStaticModule } from '@nestjs/serve-static';
import { resolve } from 'path';

@Module({
imports: [
imports: [
ServeStaticModule.forRoot({
rootPath: 'ui/dist',
rootPath: resolve('ui/dist'),
}),
ConfigModule.forRoot({ isGlobal: true, envFilePath: 'apps/view/.env' }),
],
Expand Down
5 changes: 1 addition & 4 deletions ui/src/utils/socket.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import { io } from 'socket.io-client';

const PAYMENT_URL =
process.env.NODE_ENV === 'production'
? undefined
: import.meta.env.VITE_PAYMENT_API_BASE_URL;
const PAYMENT_URL = import.meta.env.VITE_PAYMENT_API_BASE_URL;

export const paymentSocket = io(PAYMENT_URL);

0 comments on commit 50eca3f

Please sign in to comment.