The Less Unit

flitter-less/LessUnit

exports:  class LessUnit

class LessUnit

extends:  libflitter/Unit

A wrapper for the express-less package for Flitter. Makes .less assets available on the /style-asset route.

directory

type:  String

Contains the fully-qualified path to the directory with the .less files.

constructor(String style_path = './app/assets/less')

overrides:  super.constructor()  returns:  this

Initializes the class. Resolves the fully-qualified path to the directory with the .less files and stores it in this.directory.

go(express app, function next)

overrides:  super.go()  returns:  undefined

Initializes the unit. Registers the express-less package with the underlying Express app and points it to this.directory. Compiled .less files are served at the route /style-asset. This establishes the Less context and executes the next function in the stack under it.

Less Context

Guarantees that the less files in the specified directory are available at /style-asset. Note that it this context need not be above the controllers, as long as it is established above the final App context.

No Comments
Back to top