Add all repos
This commit is contained in:
parent
faa12c60bc
commit
8a91c9b89b
369 changed files with 29047 additions and 28 deletions
23
metamigo-common/plugins/config.ts
Normal file
23
metamigo-common/plugins/config.ts
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
import { Server } from "@hapi/hapi";
|
||||
import cloneDeep from "lodash/cloneDeep";
|
||||
import { deepFreeze } from "../helpers";
|
||||
|
||||
interface ConfigOptions {
|
||||
config: unknown;
|
||||
}
|
||||
|
||||
const register = async (
|
||||
server: Server,
|
||||
options: ConfigOptions
|
||||
): Promise<void> => {
|
||||
const safeConfig = deepFreeze(cloneDeep(options.config));
|
||||
server.decorate("server", "config", () => safeConfig);
|
||||
};
|
||||
|
||||
const ConfigPlugin = {
|
||||
register,
|
||||
name: "config",
|
||||
version: "0.0.1",
|
||||
};
|
||||
|
||||
export default ConfigPlugin;
|
||||
Loading…
Add table
Add a link
Reference in a new issue