Organize directories
This commit is contained in:
parent
8a91c9b89b
commit
4898382f78
433 changed files with 0 additions and 0 deletions
|
|
@ -1,23 +0,0 @@
|
|||
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