2022-03-28 22:21:15 +02:00
|
|
|
import { Logger } from '@nestjs/common';
|
2022-02-03 17:06:44 +01:00
|
|
|
import { NestFactory } from '@nestjs/core';
|
|
|
|
import { NestExpressApplication } from '@nestjs/platform-express';
|
|
|
|
import { AppModule } from './app.module';
|
2022-02-14 17:40:41 +01:00
|
|
|
import { RedisIoAdapter } from './middlewares/redis-io.adapter.middleware';
|
2022-02-03 17:06:44 +01:00
|
|
|
|
|
|
|
async function bootstrap() {
|
|
|
|
const app = await NestFactory.create<NestExpressApplication>(AppModule);
|
|
|
|
|
|
|
|
app.set('trust proxy');
|
2022-02-14 17:40:41 +01:00
|
|
|
|
|
|
|
app.useWebSocketAdapter(new RedisIoAdapter(app));
|
|
|
|
|
2022-03-28 22:21:15 +02:00
|
|
|
await app.listen(3000, () => {
|
|
|
|
if (process.env.NODE_ENV == 'development') {
|
|
|
|
Logger.log('Running Immich Server in DEVELOPMENT environment', 'IMMICH SERVER');
|
|
|
|
}
|
|
|
|
|
|
|
|
if (process.env.NODE_ENV == 'production') {
|
|
|
|
Logger.log('Running Immich Server in PRODUCTION environment', 'IMMICH SERVER');
|
|
|
|
}
|
|
|
|
});
|
2022-02-03 17:06:44 +01:00
|
|
|
}
|
|
|
|
bootstrap();
|