Skip to content
Snippets Groups Projects
Commit 0309acc9 authored by Lukáš Kratochvíl's avatar Lukáš Kratochvíl
Browse files

Merge branch 'backend-setup' into main

parents e3bfa536 ccd0f0c2
No related branches found
No related tags found
No related merge requests found
import { Module } from '@nestjs/common';
import { ConfigModule } from '@nestjs/config';
import { AppController } from './app.controller';
import { AppService } from './app.service';
@Module({
imports: [],
imports: [ConfigModule.forRoot()],
controllers: [AppController],
providers: [AppService],
})
......
......@@ -4,8 +4,9 @@ import { AppModule } from './app.module';
async function bootstrap(): Promise<void> {
const app = await NestFactory.create(AppModule);
const configService = new ConfigService();
const port = configService.get('PORT');
const configService = app.get(ConfigService);
const port = configService.get<number>('PORT');
console.log(`NestJS server is listening on: http://localhost:${port}`);
await app.listen(port);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment