Skip to content

Commit

Permalink
some fix
Browse files Browse the repository at this point in the history
  • Loading branch information
masechkacat committed Apr 29, 2024
1 parent 8921438 commit 558f511
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@ import * as cors from 'cors';

async function bootstrap() {
const app = await NestFactory.create(AppModule, { cors: true });
const port = process.env.PORT || 3000;
app.use(
cors({
origin: process.env.CORS_ORIGIN,
credentials: true,
}),
);
await app.listen(3000);
await app.listen(port, '0.0.0.0', () => {
console.log(`Application is running on: http://0.0.0.0:${port}`);
});
console.log(`Application is running on: ${await app.getUrl()}`);
}
bootstrap();

0 comments on commit 558f511

Please sign in to comment.