Skip to content

Commit

Permalink
🔧 Added .env file
Browse files Browse the repository at this point in the history
  • Loading branch information
ICEatm committed Jun 14, 2024
1 parent 60a6435 commit 36e9414
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
PREFIX=api
4 changes: 3 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ async function bootstrap() {
const app = await NestFactory.create(AppModule);

// Set `/api` as the global prefix, except for the `/` index page
app.setGlobalPrefix('api', { exclude: ['/'] });
app.setGlobalPrefix((process.env.PREFIX as string) ?? 'api', {
exclude: ['/'],
});

/**
* Enable versioning with the URI type.
Expand Down

0 comments on commit 36e9414

Please sign in to comment.