const { cleanPath } = require("../utilities/utils");
const Path = cleanPath(process.cwd() + "/providers/App");
const provider = require(Path);

async function onBoot(config) {
  await provider.boot({
    config:{...config}
  });
}

async function onRegister(config) {
 
  await provider.register({
    state: config.state,
    config:{...config}
  });
}
async function onReady(config) {
  await provider.ready({
    api: config.api,
    services: config.service,
    state: config.state,
    config:{...config}
  });
}

module.exports = {
  onBoot,
  onRegister,
  onReady,
};
