The Express Unit

libflitter/express/ExpressUnit

exports:  class ExpressUnit

class ExpressUnit

extends:  libflitter/Unit

Flitter is based on Express and various Express extensions. This unit loads the additional Express extensions like the session provider and form body parser.

go(express app, function next)

overrides:  super.go()         returns:  undefined

Initializes the unit. Loads the package busboy-body-parser and tells the underlying Express app to use it. It also loads the express-session package and configures it. Flitter sessions are configured to use UUIDs, and the session secret is loaded from the server.session.secret config value. Then, it tells the underlying Express app to use it. This unit provides the Express context and calls the next function in the stack under it.

Express Context

This context makes the busboy-body-parser and express-session packages available in the underlying Express app. This means that all Flitter forms should use the multipart type, but it also provides support for accessing submitted files via request.files.

No Comments
Back to top