Merge pull request #146 from strongloop/feature/DFD-48
Clean up loopback.js doc and add it to docs.json
This commit is contained in:
commit
f887c3e623
|
@ -2,6 +2,8 @@
|
|||
"title": "LoopBack Documentation",
|
||||
"content": [
|
||||
"lib/application.js",
|
||||
{"title": "LoopBack", "depth": 3},
|
||||
"lib/loopback.js",
|
||||
{"title": "Middleware", "depth": 3},
|
||||
"lib/middleware/token.js",
|
||||
"lib/models/access-token.js",
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/**
|
||||
/*!
|
||||
* Module dependencies.
|
||||
*/
|
||||
|
||||
|
@ -15,7 +15,15 @@ var express = require('express')
|
|||
, i8n = require('inflection');
|
||||
|
||||
/**
|
||||
* Expose `createApplication()`.
|
||||
* `loopback` is the main entry for LoopBack core module. It provides static
|
||||
* methods to create models and data sources. The module itself is a function
|
||||
* that creates loopback `app`. For example,
|
||||
*
|
||||
*
|
||||
* ```js
|
||||
* var loopback = require('loopback');
|
||||
* var app = loopback();
|
||||
* ```
|
||||
*/
|
||||
|
||||
var loopback = exports = module.exports = createApplication;
|
||||
|
@ -47,7 +55,7 @@ function createApplication() {
|
|||
return app;
|
||||
}
|
||||
|
||||
/**
|
||||
/*!
|
||||
* Expose express.middleware as loopback.*
|
||||
* for example `loopback.errorHandler` etc.
|
||||
*/
|
||||
|
@ -59,7 +67,7 @@ for (var key in express) {
|
|||
, Object.getOwnPropertyDescriptor(express, key));
|
||||
}
|
||||
|
||||
/**
|
||||
/*!
|
||||
* Expose additional loopback middleware
|
||||
* for example `loopback.configure` etc.
|
||||
*/
|
||||
|
@ -73,7 +81,7 @@ fs
|
|||
loopback[m.replace(/\.js$/, '')] = require('./middleware/' + m);
|
||||
});
|
||||
|
||||
/**
|
||||
/*!
|
||||
* Error handler title
|
||||
*/
|
||||
|
||||
|
@ -197,6 +205,9 @@ loopback.getModel = function(modelName) {
|
|||
|
||||
/**
|
||||
* Set the default `dataSource` for a given `type`.
|
||||
* @param {String} type The datasource type
|
||||
* @param {Object|DataSource} dataSource The data source settings or instance
|
||||
* @return {DataSource} The data source instance
|
||||
*/
|
||||
|
||||
loopback.setDefaultDataSourceForType = function(type, dataSource) {
|
||||
|
@ -212,6 +223,8 @@ loopback.setDefaultDataSourceForType = function(type, dataSource) {
|
|||
|
||||
/**
|
||||
* Get the default `dataSource` for a given `type`.
|
||||
* @param {String} type The datasource type
|
||||
* @return {DataSource} The data source instance
|
||||
*/
|
||||
|
||||
loopback.getDefaultDataSourceForType = function(type) {
|
||||
|
@ -262,7 +275,7 @@ loopback.RoleMapping = require('./models/role').RoleMapping;
|
|||
loopback.ACL = require('./models/acl').ACL;
|
||||
loopback.Scope = require('./models/acl').Scope;
|
||||
|
||||
/**
|
||||
/*!
|
||||
* Automatically attach these models to dataSources
|
||||
*/
|
||||
|
||||
|
|
Loading…
Reference in New Issue