async function buildApp() {
    try {
        // connect to database
        await Mongoose.connect(url, { useNewUrlParser: true });
        // create agenda instance
        const agenda = await new Agenda({ mongo: Mongoose.connection });
        // start agenda
        await agenda.start();
        // session
        app.use(session(sessionConfig))
        // static files
        app.use(express.static(process.env.AGENDASH_CLIENT_STATIC_FILE_DIRECTORY));
        // routes
        registerRoutes(app, agenda);
        return app;
    } catch (error) {
        console.log(error.stack);
        throw error;
    }    
}
/**
 * Builds App For Agendash Client
 * Connects to database
 * Initialises roots
 * Initialises session
 * Triggers Agenda & Agendash
 * @returns Express App
 * @throws Error
 */
Builds App For Agendash Client
Connects to database
Initialises roots
Initialises session
Triggers Agenda & Agendash
@returns Express App
@throws Error
Builds App For Agendash Client Connects to database Initialises roots Initialises session Triggers Agenda & Agendash @returns Express App @throws Error
async function buildApp() {
    try {
        await Mongoose.connect(url, { useNewUrlParser: true });
        const agenda = await new Agenda({ mongo: Mongoose.connection });
        await agenda.start();
        app.use(session(sessionConfig))
        app.use(express.static(process.env.AGENDASH_CLIENT_STATIC_FILE_DIRECTORY));
        registerRoutes(app, agenda);
        return app;
    } catch (error) {
        console.log(error.stack);
        throw error;
    }    
}
async function buildApp ( ) { try { await Mongoose . connect ( url , { useNewUrlParser : true } ) ; const agenda = await new Agenda ( { mongo : Mongoose . connection } ) ; await agenda . start ( ) ; app . use ( session ( sessionConfig ) ) app . use ( express . static ( process . env . AGENDASH_CLIENT_STATIC_FILE_DIRECTORY ) ) ; registerRoutes ( app , agenda ) ; return app ; } catch ( error ) { console . log ( error . stack ) ; throw error ; } }
Builds App For Agendash Client
 Connects to database
 Initialises roots
 Initialises session
 Triggers Agenda & Agendash
 @returns Express App
 @throws Error
Builds App For Agendash Client Connects to database Initialises roots Initialises session Triggers Agenda & Agendash @returns Express App @throws Error
// connect to database // create agenda instance // start agenda // session // static files // routes