                 @models[name]   = @db.define name, ModelDef
                 AfterModelDef @models[name]
 
+    # Initialize REST API context.
     configure       : () =>
         @app.set 'port', Config.Restapi.Port
         @app.use Express.logger 'dev'

        @app.get '/api', (req, res) => res.json ressources
        @app.options /.*/, (req, res) => res.send 200

    defineAllModels : () =>
        modelsPath  = Path.join __dirname, '../models'
        modelsNames = Fs.readdirSync modelsPath

        do @defineAllRoutes
        @configured = true

    # Start the REST API services.
    start       : () =>
        @db.on 'connected', () =>
            do @configure if not @configured
