*Add app getter method to api
This commit is contained in:
parent
356681af35
commit
3ac8e38f66
|
@ -19,3 +19,7 @@ export async function start() {
|
|||
|
||||
await app.listen({ port: config.uint("core.appport"), host: "0.0.0.0" });
|
||||
}
|
||||
|
||||
export function get(): FastifyInstance {
|
||||
return app;
|
||||
}
|
||||
|
|
|
@ -17,6 +17,7 @@ import {
|
|||
ProtocolManager,
|
||||
} from "./swarm.js";
|
||||
import { get as getSSl, SSLManager } from "./ssl.js";
|
||||
import { get as getApp } from "./app.js";
|
||||
import type { HDKey } from "micro-ed25519-hdkey";
|
||||
import corePlugins from "../plugins";
|
||||
import Util from "./plugin/util";
|
||||
|
@ -95,6 +96,10 @@ class PluginAPI extends EventEmitter2 {
|
|||
return getProtocolManager();
|
||||
}
|
||||
|
||||
get app() {
|
||||
return getApp();
|
||||
}
|
||||
|
||||
public loadPlugin(
|
||||
moduleName: string
|
||||
): (moduleName: string) => Promise<Plugin> {
|
||||
|
|
Loading…
Reference in New Issue