const deppie = require('../index');

// modules
const config = { port: 8088 };
const apiClient = require('./modules/api-client');
const routes = require('./routes');
const app = require('./app');

// the modules need to be defined in order of dependency
// each module is an object with one key (module name) and the value is the module
const moduleDefinitions = [
    // the first module can't have any dependencies
    { config: () => config },
    { apiClient },
    { routes },
    { app },
    // the last module(s) are the entry points since they cannot be used by any other modules
];

// bootstrap all modules
deppie(moduleDefinitions);

const deppie = require('deppie');

// modules
const config = { port: 8088 };
const apiClient = require('./modules/api-client');
const routes = require('./routes');
const app = require('./app');

// the modules need to be defined in order of dependency
// each module is an object with one key (module name) and the value is the module
const moduleDefinitions = [
    // the first module can't have any dependencies
    { config: () => config },
    { apiClient },
    { routes },
    { app },
    // the last module(s) are the entry points since they cannot be used by any other modules
];

// bootstrap all modules
deppie(moduleDefinitions);

use public module in example