Merge branch 'release/1.4.2' into production
This commit is contained in:
commit
754fda9dec
|
@ -4,6 +4,10 @@
|
||||||
|
|
||||||
[See the full documentation](http://docs.strongloop.com/display/DOC/LoopBack).
|
[See the full documentation](http://docs.strongloop.com/display/DOC/LoopBack).
|
||||||
|
|
||||||
|
## API
|
||||||
|
|
||||||
|
[Browse the API documentation](http://apidocs.strongloop.com/loopback).
|
||||||
|
|
||||||
## Mailing List
|
## Mailing List
|
||||||
|
|
||||||
Discuss features and ask questions on [LoopBack Forum](https://groups.google.com/forum/#!forum/loopbackjs).
|
Discuss features and ask questions on [LoopBack Forum](https://groups.google.com/forum/#!forum/loopbackjs).
|
||||||
|
|
14
docs/api.md
14
docs/api.md
|
@ -1,8 +1,8 @@
|
||||||
## Node.js API
|
## Node.js API
|
||||||
|
|
||||||
* [App](api-app.md)
|
* [App](#app-object)
|
||||||
* [Model](api-model.md)
|
* [DataSource](#data-source-object)
|
||||||
* [Remote methods and hooks](api-model-remote.md)
|
* [GeoPoint](#geopoint-object)
|
||||||
* [DataSource](api-datasource.md)
|
* [Model](#model-object)
|
||||||
* [GeoPoint](api-geopoint.md)
|
* [Remote methods and hooks](#remote-methods-and-hooks)
|
||||||
* [REST API](rest.md)
|
* [REST API](#rest-api)
|
||||||
|
|
2
index.js
2
index.js
|
@ -3,6 +3,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var loopback = module.exports = require('./lib/loopback');
|
var loopback = module.exports = require('./lib/loopback');
|
||||||
|
var datasourceJuggler = require('loopback-datasource-juggler');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Connectors
|
* Connectors
|
||||||
|
@ -17,3 +18,4 @@ loopback.Mail = require('./lib/connectors/mail');
|
||||||
*/
|
*/
|
||||||
|
|
||||||
loopback.GeoPoint = require('loopback-datasource-juggler/lib/geo').GeoPoint;
|
loopback.GeoPoint = require('loopback-datasource-juggler/lib/geo').GeoPoint;
|
||||||
|
loopback.ValidationError = datasourceJuggler.ValidationError;
|
||||||
|
|
|
@ -241,6 +241,11 @@ app.boot = function(options) {
|
||||||
app.get('port') ||
|
app.get('port') ||
|
||||||
3000;
|
3000;
|
||||||
|
|
||||||
|
appConfig.restApiRoot =
|
||||||
|
appConfig.restApiRoot ||
|
||||||
|
app.get('restApiRoot') ||
|
||||||
|
'/api';
|
||||||
|
|
||||||
if(appConfig.host !== undefined) {
|
if(appConfig.host !== undefined) {
|
||||||
assert(typeof appConfig.host === 'string', 'app.host must be a string');
|
assert(typeof appConfig.host === 'string', 'app.host must be a string');
|
||||||
app.set('host', appConfig.host);
|
app.set('host', appConfig.host);
|
||||||
|
@ -252,6 +257,11 @@ app.boot = function(options) {
|
||||||
app.set('port', appConfig.port);
|
app.set('port', appConfig.port);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
assert(appConfig.restApiRoot !== undefined, 'app.restBasePath is required');
|
||||||
|
assert(typeof appConfig.restApiRoot === 'string', 'app.restBasePath must be a string');
|
||||||
|
assert(/^\//.test(appConfig.restApiRoot), 'app.restBasePath must start with "/"');
|
||||||
|
app.set('restApiRoot', appConfig.restBasePath);
|
||||||
|
|
||||||
for(var configKey in appConfig) {
|
for(var configKey in appConfig) {
|
||||||
var cur = app.get(configKey);
|
var cur = app.get(configKey);
|
||||||
if(cur === undefined || cur === null) {
|
if(cur === undefined || cur === null) {
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
"Platform",
|
"Platform",
|
||||||
"mBaaS"
|
"mBaaS"
|
||||||
],
|
],
|
||||||
"version": "1.4.1",
|
"version": "1.4.2",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "mocha -R spec"
|
"test": "mocha -R spec"
|
||||||
},
|
},
|
||||||
|
|
|
@ -44,6 +44,7 @@ describe('app', function() {
|
||||||
app: {
|
app: {
|
||||||
port: 3000,
|
port: 3000,
|
||||||
host: '127.0.0.1',
|
host: '127.0.0.1',
|
||||||
|
restApiRoot: '/rest-api',
|
||||||
foo: {bar: 'bat'},
|
foo: {bar: 'bat'},
|
||||||
baz: true
|
baz: true
|
||||||
},
|
},
|
||||||
|
@ -71,6 +72,10 @@ describe('app', function() {
|
||||||
assert.equal(this.app.get('host'), '127.0.0.1');
|
assert.equal(this.app.get('host'), '127.0.0.1');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should have restApiRoot setting', function() {
|
||||||
|
assert.equal(this.app.get('restApiRoot'), '/rest-api');
|
||||||
|
});
|
||||||
|
|
||||||
it('should have other settings', function () {
|
it('should have other settings', function () {
|
||||||
expect(this.app.get('foo')).to.eql({
|
expect(this.app.get('foo')).to.eql({
|
||||||
bar: 'bat'
|
bar: 'bat'
|
||||||
|
|
|
@ -1,4 +1,11 @@
|
||||||
describe('loopback', function() {
|
describe('loopback', function() {
|
||||||
|
describe('exports', function() {
|
||||||
|
it('ValidationError', function() {
|
||||||
|
expect(loopback.ValidationError).to.be.a('function')
|
||||||
|
.and.have.property('name', 'ValidationError');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
describe('loopback.createDataSource(options)', function(){
|
describe('loopback.createDataSource(options)', function(){
|
||||||
it('Create a data source with a connector.', function() {
|
it('Create a data source with a connector.', function() {
|
||||||
var dataSource = loopback.createDataSource({
|
var dataSource = loopback.createDataSource({
|
||||||
|
|
Loading…
Reference in New Issue