-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.ts
30 lines (23 loc) · 855 Bytes
/
main.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import { Logger } from '@nestjs/common';
import { ConfigService } from '@nestjs/config';
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { EnvironmentVariables } from './types/common';
const bootstrap = async () => {
const app = await NestFactory.create(AppModule);
const configService = app.get(ConfigService<EnvironmentVariables, true>);
const logger = new Logger('NestApplication');
const port = configService.get<number>('PORT');
const host = configService.get<string>('HOST');
await app.listen(port, () => {
logger.log(`Server ready at ${host}:${port}`);
const object = {
age: 23,
birthDate: new Date(),
name: 'marion',
};
logger.log(object);
// logger.log(`Server ready at ${host}:${port}${graphqlServer.graphqlPath}`);
});
};
void bootstrap();