The Almighty, the All-Powerful, the Flitter App

libflitter/app/FlitterApp

exports:  class FlitterApp

class FlitterApp

This is the absolute core of Flitter. This class contains the logic to create the underlying Express install, load the Units, chain them together, then run the initialization stack.

app

type:  express

The underlying Express application instance.

units

type:  Object

An Object of key-value pairs where the key is the name of the Unit and the value is an instance of the Unit class (should be libflitter/Unit). These units are chained in order such that each Unit has access to the context of those preceding it.

constructor(Object unit_classes)

returns:  this

Initializes the class. Stores the provided unit_classes in this.units. Creates a new Express app and stores it in this.app.

up()

returns:  undefined

Chains the units in this.units in order, passing each the function to start the next. For each unit, it processes the provides() output and stores it in _flit. Then, it calls the first unit in the chain to start initializing Flitter.

No Comments
Back to top