28 lines
426 B
TypeScript
28 lines
426 B
TypeScript
import * as amqp from "amqplib";
|
|
|
|
|
|
export class Rabbit {
|
|
|
|
connection!: amqp.ChannelModel;
|
|
|
|
channel!: amqp.Channel;
|
|
|
|
|
|
async connect(){
|
|
|
|
this.connection =
|
|
await amqp.connect(
|
|
"amqp://manager:gigi1337@192.168.1.74"
|
|
);
|
|
|
|
|
|
this.channel =
|
|
await this.connection.createChannel();
|
|
|
|
|
|
console.log(
|
|
"RabbitMQ verbunden"
|
|
);
|
|
}
|
|
|
|
} |