2020-04-16 20:38:01 +00:00
|
|
|
/*
|
|
|
|
* Load the units file.
|
|
|
|
* -------------------------------------------------------------
|
|
|
|
* This file contains an ordered object of unit files. Flitter will load these
|
|
|
|
* one at a time to launch the application. Each unit in the sequence is passed
|
|
|
|
* the function for the next unit in the sequence. This forms the function stack
|
|
|
|
* by chaining the units together, ending with the Flitter App unit.
|
|
|
|
*/
|
|
|
|
const units = require('./Units.flitter')
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Create the app.
|
|
|
|
* -------------------------------------------------------------
|
|
|
|
* The FlitterApp object contains the wrapper for the Express app, as well as
|
|
|
|
* the initialization function that chains together the individual units. This
|
|
|
|
* is why we pass it the units.
|
|
|
|
*/
|
2020-04-21 03:46:19 +00:00
|
|
|
const { FlitterApp, RunLevelErrorHandler } = require('libflitter')
|
2020-04-16 20:38:01 +00:00
|
|
|
const flitter = new FlitterApp(units)
|
2020-04-21 03:46:19 +00:00
|
|
|
const rleh = new RunLevelErrorHandler()
|
2020-04-16 20:38:01 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Launch the server.
|
|
|
|
* -------------------------------------------------------------
|
|
|
|
* This calls the first unit in the unit chain. This chain ends with the Flitter
|
|
|
|
* server component which launches the Node HTTP server.
|
|
|
|
*/
|
2020-04-21 03:46:19 +00:00
|
|
|
flitter.run().catch(rleh.handle)
|