🌊 Added connect endpoint

This commit is contained in:
2023-09-01 11:23:42 -05:00
parent 09061905bb
commit e49c9c985a
3 changed files with 66 additions and 9 deletions

View File

@@ -1,5 +1,6 @@
"use strict";
import { Context, Service, ServiceBroker, ServiceSchema, Errors } from "moleculer";
import { qBittorrentClient } from "@robertklep/qbittorrent";
export default class QBittorrentService extends Service {
// @ts-ignore
@@ -16,6 +17,12 @@ export default class QBittorrentService extends Service {
connect: {
rest: "POST /connect",
handler: async (ctx: Context<{}>) => {
const client = new qBittorrentClient(
"http://127.0.0.1:8080",
"admin",
"adminadmin",
);
console.log(client);
return { foo: "bar" };
},
},