*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" });
|
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,
|
ProtocolManager,
|
||||||
} from "./swarm.js";
|
} from "./swarm.js";
|
||||||
import { get as getSSl, SSLManager } from "./ssl.js";
|
import { get as getSSl, SSLManager } from "./ssl.js";
|
||||||
|
import { get as getApp } from "./app.js";
|
||||||
import type { HDKey } from "micro-ed25519-hdkey";
|
import type { HDKey } from "micro-ed25519-hdkey";
|
||||||
import corePlugins from "../plugins";
|
import corePlugins from "../plugins";
|
||||||
import Util from "./plugin/util";
|
import Util from "./plugin/util";
|
||||||
|
@ -95,6 +96,10 @@ class PluginAPI extends EventEmitter2 {
|
||||||
return getProtocolManager();
|
return getProtocolManager();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get app() {
|
||||||
|
return getApp();
|
||||||
|
}
|
||||||
|
|
||||||
public loadPlugin(
|
public loadPlugin(
|
||||||
moduleName: string
|
moduleName: string
|
||||||
): (moduleName: string) => Promise<Plugin> {
|
): (moduleName: string) => Promise<Plugin> {
|
||||||
|
|
Loading…
Reference in New Issue