AM
Size: a a a
AM
OR
И
И
AM
И
req.user xDИ
AM
req.user xDИ
AM
И
AM
И
И
И
V
V
import { Module } from '@nestjs/common';
import { BullModule } from '@nestjs/bull';
import { AppController } from './app.controller';
import { AppService } from './app.service';
@Module({
imports: [
BullModule.registerQueue({
name: 'terminalString',
redis: {
host: 'localhost',
port: 6379
}
})
],
controllers: [AppController],
providers: [AppService],
})
export class AppModule {}V
import { Injectable } from '@nestjs/common';
import { Queue } from 'bull';
import { InjectQueue } from '@nestjs/bull';
@Injectable()
export class AppService {
constructor(@InjectQueue('terminalString') private readonly terminalQueue: Queue) {}
getHello(): string {
const simpleStr = 'Hello World!';
console.log(simpleStr);
return simpleStr
}
}V
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();
}
}И