mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
Added nestjs microservice
This commit is contained in:
parent
5c9d3cd08b
commit
fe693db84f
16 changed files with 6821 additions and 1 deletions
12
microservices/src/app.controller.ts
Normal file
12
microservices/src/app.controller.ts
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
import { Controller, Get } from '@nestjs/common';
|
||||
import { AppService } from './app.service';
|
||||
|
||||
@Controller()
|
||||
export class AppController {
|
||||
constructor(private readonly appService: AppService) {}
|
||||
|
||||
@Get()
|
||||
getHello(): string {
|
||||
return this.appService.getHello();
|
||||
}
|
||||
}
|
||||
10
microservices/src/app.module.ts
Normal file
10
microservices/src/app.module.ts
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
import { Module } from '@nestjs/common';
|
||||
import { AppController } from './app.controller';
|
||||
import { AppService } from './app.service';
|
||||
|
||||
@Module({
|
||||
imports: [],
|
||||
controllers: [AppController],
|
||||
providers: [AppService],
|
||||
})
|
||||
export class AppModule {}
|
||||
9
microservices/src/app.service.ts
Normal file
9
microservices/src/app.service.ts
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
import { Injectable } from '@nestjs/common';
|
||||
|
||||
@Injectable()
|
||||
export class AppService {
|
||||
getHello(): string {
|
||||
console.log('Hello World 123');
|
||||
return 'Hello World!';
|
||||
}
|
||||
}
|
||||
15
microservices/src/main.ts
Normal file
15
microservices/src/main.ts
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
import { NestFactory } from '@nestjs/core';
|
||||
import { AppModule } from './app.module';
|
||||
import { AppService } from './app.service';
|
||||
|
||||
async function bootstrap() {
|
||||
const app = await NestFactory.createApplicationContext(AppModule);
|
||||
|
||||
const appService = app.get(AppService);
|
||||
|
||||
appService.getHello();
|
||||
|
||||
await app.close();
|
||||
}
|
||||
|
||||
bootstrap();
|
||||
Loading…
Add table
Add a link
Reference in a new issue