nestjs-aws-e
v1.2.1
Published
conexion a amazon aws, servicio SNS,SQS, publishing message and Reciver
Downloads
11
Readme
##Installation"
npm i nestjs-aws-e
##import
app.module.ts
import { Module } from '@nestjs/common';
import { AppController } from './app.controller';
import { AppService } from './app.service';
import { AwsNestModule } from 'nestjs-aws-e';
@Module({
imports: [
AwsNestModule.forRootSnsAsync({
useFactory: async () => {
return {
accessKeyId: '',
secretAccessKey: '',
region: '',
};
},
inject: [],
}),
],
controllers: [AppController],
providers: [AppService],
})
export class AppModule {}
app.controller.ts
import { Controller, Get } from '@nestjs/common';
import { AwsSnsService } from 'nestjs-aws-e';
@Controller()
export class AppController {
constructor(
private awsSnsService: AwsSnsService,
) {}
@Get('send-message')
getSendMessage() {
const params = {
Message: 'Hooola' /* required */,
TopicArn: '',
};
const v = this.awsSnsService.sendSNS(params);
return v;
}
}