1
0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2025-01-09 13:26:47 +01:00
immich/server/apps/microservices/src/main.ts
2023-03-31 09:36:08 -05:00

26 lines
876 B
TypeScript

import { Logger } from '@nestjs/common';
import { NestFactory } from '@nestjs/core';
import { SERVER_VERSION } from '@app/domain';
import { getLogLevels } from '@app/domain';
import { RedisIoAdapter } from '@app/infra';
import { MicroservicesModule } from './microservices.module';
const logger = new Logger('ImmichMicroservice');
async function bootstrap() {
const app = await NestFactory.create(MicroservicesModule, {
logger: getLogLevels(),
});
const listeningPort = Number(process.env.MICROSERVICES_PORT) || 3002;
app.useWebSocketAdapter(new RedisIoAdapter(app));
await app.listen(listeningPort, () => {
const envName = (process.env.NODE_ENV || 'development').toUpperCase();
logger.log(
`Running Immich Microservices in ${envName} environment - version ${SERVER_VERSION} - Listening on port: ${listeningPort}`,
);
});
}
bootstrap();