🏗️ Configured the service transporter
This commit is contained in:
26
services/qbittorrent.service.ts
Normal file
26
services/qbittorrent.service.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
"use strict";
|
||||
import { Context, Service, ServiceBroker, ServiceSchema, Errors } from "moleculer";
|
||||
|
||||
export default class QBittorrentService extends Service {
|
||||
// @ts-ignore
|
||||
public constructor(
|
||||
public broker: ServiceBroker,
|
||||
schema: ServiceSchema<{}> = { name: "qbittorrent" },
|
||||
) {
|
||||
super(broker);
|
||||
this.parseServiceSchema({
|
||||
name: "qbittorrent",
|
||||
mixins: [],
|
||||
hooks: {},
|
||||
actions: {
|
||||
connect: {
|
||||
rest: "POST /connect",
|
||||
handler: async (ctx: Context<{}>) => {
|
||||
return { foo: "bar" };
|
||||
},
|
||||
},
|
||||
},
|
||||
methods: {},
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user