🏗️ Configured the service transporter
This commit is contained in:
@@ -14,7 +14,7 @@ const ApiService: ServiceSchema<ApiSettingsSchema> = {
|
||||
// More info about settings: https://moleculer.services/docs/0.14/moleculer-web.html
|
||||
settings: {
|
||||
// Exposed port
|
||||
port: process.env.PORT != null ? Number(process.env.PORT) : 3000,
|
||||
port: process.env.PORT != null ? Number(process.env.PORT) : 3060,
|
||||
|
||||
// Exposed IP
|
||||
ip: "0.0.0.0",
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
"use strict";
|
||||
import { Context, Service, ServiceBroker, ServiceSchema, Errors } from "moleculer";
|
||||
|
||||
export default class TorrentService extends Service {
|
||||
// @ts-ignore
|
||||
public constructor(
|
||||
public broker: ServiceBroker,
|
||||
schema: ServiceSchema<{}> = { name: "torrent" },
|
||||
) {
|
||||
super(broker);
|
||||
this.parseServiceSchema({
|
||||
name: "torrent",
|
||||
mixins: [],
|
||||
hooks: {},
|
||||
actions: {},
|
||||
methods: {},
|
||||
});
|
||||
}
|
||||
}
|
||||
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