Add test fixtures for shared methods
This commit is contained in:
parent
9a33602458
commit
716ed4569f
|
@ -0,0 +1,3 @@
|
|||
module.exports = function(Todo) {
|
||||
|
||||
};
|
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
"name": "Todo",
|
||||
"base": "PersistedModel",
|
||||
"idInjection": true,
|
||||
"options": {
|
||||
"validateUpsert": true
|
||||
},
|
||||
"properties": {
|
||||
"content": {
|
||||
"type": "string",
|
||||
"required": true
|
||||
}
|
||||
},
|
||||
"validations": [],
|
||||
"relations": {},
|
||||
"acls": [],
|
||||
"methods": {}
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
{
|
||||
"restApiRoot": "/api",
|
||||
"host": "0.0.0.0",
|
||||
"port": 3000,
|
||||
"remoting": {
|
||||
"context": {
|
||||
"enableHttpContext": false
|
||||
},
|
||||
"rest": {
|
||||
"normalizeHttpPath": false,
|
||||
"xml": false
|
||||
},
|
||||
"json": {
|
||||
"strict": false,
|
||||
"limit": "100kb"
|
||||
},
|
||||
"urlencoded": {
|
||||
"extended": true,
|
||||
"limit": "100kb"
|
||||
},
|
||||
"cors": false,
|
||||
"errorHandler": {
|
||||
"disableStackTrace": false
|
||||
},
|
||||
"sharedMethods": {
|
||||
"*": false,
|
||||
"destroyAll": true
|
||||
}
|
||||
},
|
||||
"legacyExplorer": false
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"db": {
|
||||
"name": "db",
|
||||
"connector": "memory"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,46 @@
|
|||
{
|
||||
"_meta": {
|
||||
"sources": [
|
||||
"loopback/common/models",
|
||||
"loopback/server/models",
|
||||
"../common/models",
|
||||
"./models"
|
||||
],
|
||||
"mixins": [
|
||||
"loopback/common/mixins",
|
||||
"loopback/server/mixins",
|
||||
"../common/mixins",
|
||||
"./mixins"
|
||||
]
|
||||
},
|
||||
"User": {
|
||||
"dataSource": "db"
|
||||
},
|
||||
"AccessToken": {
|
||||
"dataSource": "db",
|
||||
"public": false
|
||||
},
|
||||
"ACL": {
|
||||
"dataSource": "db",
|
||||
"public": false
|
||||
},
|
||||
"RoleMapping": {
|
||||
"dataSource": "db",
|
||||
"public": false
|
||||
},
|
||||
"Role": {
|
||||
"dataSource": "db",
|
||||
"public": false
|
||||
},
|
||||
"Todo": {
|
||||
"dataSource": "db",
|
||||
"public": true,
|
||||
"options": {
|
||||
"remoting": {
|
||||
"sharedMethods": {
|
||||
"destroyAll": false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
var boot = require('loopback-boot');
|
||||
var loopback = require('../../../../../index');
|
||||
|
||||
var app = module.exports = loopback();
|
||||
boot(app, __dirname);
|
||||
app.use(loopback.rest());
|
|
@ -0,0 +1,3 @@
|
|||
module.exports = function(Todo) {
|
||||
|
||||
};
|
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
"name": "Todo",
|
||||
"base": "PersistedModel",
|
||||
"idInjection": true,
|
||||
"options": {
|
||||
"validateUpsert": true
|
||||
},
|
||||
"properties": {
|
||||
"content": {
|
||||
"type": "string",
|
||||
"required": true
|
||||
}
|
||||
},
|
||||
"validations": [],
|
||||
"relations": {},
|
||||
"acls": [],
|
||||
"methods": {}
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
{
|
||||
"restApiRoot": "/api",
|
||||
"host": "0.0.0.0",
|
||||
"port": 3000,
|
||||
"remoting": {
|
||||
"context": {
|
||||
"enableHttpContext": false
|
||||
},
|
||||
"rest": {
|
||||
"normalizeHttpPath": false,
|
||||
"xml": false
|
||||
},
|
||||
"json": {
|
||||
"strict": false,
|
||||
"limit": "100kb"
|
||||
},
|
||||
"urlencoded": {
|
||||
"extended": true,
|
||||
"limit": "100kb"
|
||||
},
|
||||
"cors": false,
|
||||
"errorHandler": {
|
||||
"disableStackTrace": false
|
||||
},
|
||||
"sharedMethods": {
|
||||
"*": false
|
||||
}
|
||||
},
|
||||
"legacyExplorer": false
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"db": {
|
||||
"name": "db",
|
||||
"connector": "memory"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
{
|
||||
"_meta": {
|
||||
"sources": [
|
||||
"loopback/common/models",
|
||||
"loopback/server/models",
|
||||
"../common/models",
|
||||
"./models"
|
||||
],
|
||||
"mixins": [
|
||||
"loopback/common/mixins",
|
||||
"loopback/server/mixins",
|
||||
"../common/mixins",
|
||||
"./mixins"
|
||||
]
|
||||
},
|
||||
"User": {
|
||||
"dataSource": "db"
|
||||
},
|
||||
"AccessToken": {
|
||||
"dataSource": "db",
|
||||
"public": false
|
||||
},
|
||||
"ACL": {
|
||||
"dataSource": "db",
|
||||
"public": false
|
||||
},
|
||||
"RoleMapping": {
|
||||
"dataSource": "db",
|
||||
"public": false
|
||||
},
|
||||
"Role": {
|
||||
"dataSource": "db",
|
||||
"public": false
|
||||
},
|
||||
"Todo": {
|
||||
"dataSource": "db",
|
||||
"public": true
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
var boot = require('loopback-boot');
|
||||
var loopback = require('../../../../../index');
|
||||
|
||||
var app = module.exports = loopback();
|
||||
boot(app, __dirname);
|
||||
app.use(loopback.rest());
|
|
@ -0,0 +1,3 @@
|
|||
module.exports = function(Todo) {
|
||||
|
||||
};
|
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
"name": "Todo",
|
||||
"base": "PersistedModel",
|
||||
"idInjection": true,
|
||||
"options": {
|
||||
"validateUpsert": true
|
||||
},
|
||||
"properties": {
|
||||
"content": {
|
||||
"type": "string",
|
||||
"required": true
|
||||
}
|
||||
},
|
||||
"validations": [],
|
||||
"relations": {},
|
||||
"acls": [],
|
||||
"methods": {}
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
{
|
||||
"restApiRoot": "/api",
|
||||
"host": "0.0.0.0",
|
||||
"port": 3000,
|
||||
"remoting": {
|
||||
"context": {
|
||||
"enableHttpContext": false
|
||||
},
|
||||
"rest": {
|
||||
"normalizeHttpPath": false,
|
||||
"xml": false
|
||||
},
|
||||
"json": {
|
||||
"strict": false,
|
||||
"limit": "100kb"
|
||||
},
|
||||
"urlencoded": {
|
||||
"extended": true,
|
||||
"limit": "100kb"
|
||||
},
|
||||
"cors": false,
|
||||
"errorHandler": {
|
||||
"disableStackTrace": false
|
||||
},
|
||||
"sharedMethods": {
|
||||
"*": true
|
||||
}
|
||||
},
|
||||
"legacyExplorer": false
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"db": {
|
||||
"name": "db",
|
||||
"connector": "memory"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
{
|
||||
"_meta": {
|
||||
"sources": [
|
||||
"loopback/common/models",
|
||||
"loopback/server/models",
|
||||
"../common/models",
|
||||
"./models"
|
||||
],
|
||||
"mixins": [
|
||||
"loopback/common/mixins",
|
||||
"loopback/server/mixins",
|
||||
"../common/mixins",
|
||||
"./mixins"
|
||||
]
|
||||
},
|
||||
"User": {
|
||||
"dataSource": "db"
|
||||
},
|
||||
"AccessToken": {
|
||||
"dataSource": "db",
|
||||
"public": false
|
||||
},
|
||||
"ACL": {
|
||||
"dataSource": "db",
|
||||
"public": false
|
||||
},
|
||||
"RoleMapping": {
|
||||
"dataSource": "db",
|
||||
"public": false
|
||||
},
|
||||
"Role": {
|
||||
"dataSource": "db",
|
||||
"public": false
|
||||
},
|
||||
"Todo": {
|
||||
"dataSource": "db",
|
||||
"public": true
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
var boot = require('loopback-boot');
|
||||
var loopback = require('../../../../../index');
|
||||
|
||||
var app = module.exports = loopback();
|
||||
boot(app, __dirname);
|
||||
app.use(loopback.rest());
|
|
@ -0,0 +1,3 @@
|
|||
module.exports = function(Todo) {
|
||||
|
||||
};
|
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
"name": "Todo",
|
||||
"base": "PersistedModel",
|
||||
"idInjection": true,
|
||||
"options": {
|
||||
"validateUpsert": true
|
||||
},
|
||||
"properties": {
|
||||
"content": {
|
||||
"type": "string",
|
||||
"required": true
|
||||
}
|
||||
},
|
||||
"validations": [],
|
||||
"relations": {},
|
||||
"acls": [],
|
||||
"methods": {}
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
{
|
||||
"restApiRoot": "/api",
|
||||
"host": "0.0.0.0",
|
||||
"port": 3000,
|
||||
"remoting": {
|
||||
"context": {
|
||||
"enableHttpContext": false
|
||||
},
|
||||
"rest": {
|
||||
"normalizeHttpPath": false,
|
||||
"xml": false
|
||||
},
|
||||
"json": {
|
||||
"strict": false,
|
||||
"limit": "100kb"
|
||||
},
|
||||
"urlencoded": {
|
||||
"extended": true,
|
||||
"limit": "100kb"
|
||||
},
|
||||
"cors": false,
|
||||
"errorHandler": {
|
||||
"disableStackTrace": false
|
||||
},
|
||||
"sharedMethods": {
|
||||
"find": false
|
||||
}
|
||||
},
|
||||
"legacyExplorer": false
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"db": {
|
||||
"name": "db",
|
||||
"connector": "memory"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
{
|
||||
"_meta": {
|
||||
"sources": [
|
||||
"loopback/common/models",
|
||||
"loopback/server/models",
|
||||
"../common/models",
|
||||
"./models"
|
||||
],
|
||||
"mixins": [
|
||||
"loopback/common/mixins",
|
||||
"loopback/server/mixins",
|
||||
"../common/mixins",
|
||||
"./mixins"
|
||||
]
|
||||
},
|
||||
"User": {
|
||||
"dataSource": "db"
|
||||
},
|
||||
"AccessToken": {
|
||||
"dataSource": "db",
|
||||
"public": false
|
||||
},
|
||||
"ACL": {
|
||||
"dataSource": "db",
|
||||
"public": false
|
||||
},
|
||||
"RoleMapping": {
|
||||
"dataSource": "db",
|
||||
"public": false
|
||||
},
|
||||
"Role": {
|
||||
"dataSource": "db",
|
||||
"public": false
|
||||
},
|
||||
"Todo": {
|
||||
"dataSource": "db",
|
||||
"public": true
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
var boot = require('loopback-boot');
|
||||
var loopback = require('../../../../../index');
|
||||
|
||||
var app = module.exports = loopback();
|
||||
boot(app, __dirname);
|
||||
app.use(loopback.rest());
|
|
@ -0,0 +1,3 @@
|
|||
module.exports = function(Todo) {
|
||||
|
||||
};
|
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
"name": "Todo",
|
||||
"base": "PersistedModel",
|
||||
"idInjection": true,
|
||||
"options": {
|
||||
"validateUpsert": true
|
||||
},
|
||||
"properties": {
|
||||
"content": {
|
||||
"type": "string",
|
||||
"required": true
|
||||
}
|
||||
},
|
||||
"validations": [],
|
||||
"relations": {},
|
||||
"acls": [],
|
||||
"methods": {}
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
{
|
||||
"restApiRoot": "/api",
|
||||
"host": "0.0.0.0",
|
||||
"port": 3000,
|
||||
"remoting": {
|
||||
"context": {
|
||||
"enableHttpContext": false
|
||||
},
|
||||
"rest": {
|
||||
"normalizeHttpPath": false,
|
||||
"xml": false
|
||||
},
|
||||
"json": {
|
||||
"strict": false,
|
||||
"limit": "100kb"
|
||||
},
|
||||
"urlencoded": {
|
||||
"extended": true,
|
||||
"limit": "100kb"
|
||||
},
|
||||
"cors": false,
|
||||
"errorHandler": {
|
||||
"disableStackTrace": false
|
||||
},
|
||||
"sharedMethods": {
|
||||
"find": true
|
||||
}
|
||||
},
|
||||
"legacyExplorer": false
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"db": {
|
||||
"name": "db",
|
||||
"connector": "memory"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
{
|
||||
"_meta": {
|
||||
"sources": [
|
||||
"loopback/common/models",
|
||||
"loopback/server/models",
|
||||
"../common/models",
|
||||
"./models"
|
||||
],
|
||||
"mixins": [
|
||||
"loopback/common/mixins",
|
||||
"loopback/server/mixins",
|
||||
"../common/mixins",
|
||||
"./mixins"
|
||||
]
|
||||
},
|
||||
"User": {
|
||||
"dataSource": "db"
|
||||
},
|
||||
"AccessToken": {
|
||||
"dataSource": "db",
|
||||
"public": false
|
||||
},
|
||||
"ACL": {
|
||||
"dataSource": "db",
|
||||
"public": false
|
||||
},
|
||||
"RoleMapping": {
|
||||
"dataSource": "db",
|
||||
"public": false
|
||||
},
|
||||
"Role": {
|
||||
"dataSource": "db",
|
||||
"public": false
|
||||
},
|
||||
"Todo": {
|
||||
"dataSource": "db",
|
||||
"public": true
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
var boot = require('loopback-boot');
|
||||
var loopback = require('../../../../../index');
|
||||
|
||||
var app = module.exports = loopback();
|
||||
boot(app, __dirname);
|
||||
app.use(loopback.rest());
|
3
test/fixtures/shared-methods/model-config-default-false/common/models/todo.js
vendored
Normal file
3
test/fixtures/shared-methods/model-config-default-false/common/models/todo.js
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
module.exports = function(Todo) {
|
||||
|
||||
};
|
18
test/fixtures/shared-methods/model-config-default-false/common/models/todo.json
vendored
Normal file
18
test/fixtures/shared-methods/model-config-default-false/common/models/todo.json
vendored
Normal file
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
"name": "Todo",
|
||||
"base": "PersistedModel",
|
||||
"idInjection": true,
|
||||
"options": {
|
||||
"validateUpsert": true
|
||||
},
|
||||
"properties": {
|
||||
"content": {
|
||||
"type": "string",
|
||||
"required": true
|
||||
}
|
||||
},
|
||||
"validations": [],
|
||||
"relations": {},
|
||||
"acls": [],
|
||||
"methods": {}
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
{
|
||||
"restApiRoot": "/api",
|
||||
"host": "0.0.0.0",
|
||||
"port": 3000,
|
||||
"remoting": {
|
||||
"context": {
|
||||
"enableHttpContext": false
|
||||
},
|
||||
"rest": {
|
||||
"normalizeHttpPath": false,
|
||||
"xml": false
|
||||
},
|
||||
"json": {
|
||||
"strict": false,
|
||||
"limit": "100kb"
|
||||
},
|
||||
"urlencoded": {
|
||||
"extended": true,
|
||||
"limit": "100kb"
|
||||
},
|
||||
"cors": false,
|
||||
"errorHandler": {
|
||||
"disableStackTrace": false
|
||||
}
|
||||
},
|
||||
"legacyExplorer": false
|
||||
}
|
||||
|
6
test/fixtures/shared-methods/model-config-default-false/server/datasources.json
vendored
Normal file
6
test/fixtures/shared-methods/model-config-default-false/server/datasources.json
vendored
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"db": {
|
||||
"name": "db",
|
||||
"connector": "memory"
|
||||
}
|
||||
}
|
46
test/fixtures/shared-methods/model-config-default-false/server/model-config.json
vendored
Normal file
46
test/fixtures/shared-methods/model-config-default-false/server/model-config.json
vendored
Normal file
|
@ -0,0 +1,46 @@
|
|||
{
|
||||
"_meta": {
|
||||
"sources": [
|
||||
"loopback/common/models",
|
||||
"loopback/server/models",
|
||||
"../common/models",
|
||||
"./models"
|
||||
],
|
||||
"mixins": [
|
||||
"loopback/common/mixins",
|
||||
"loopback/server/mixins",
|
||||
"../common/mixins",
|
||||
"./mixins"
|
||||
]
|
||||
},
|
||||
"User": {
|
||||
"dataSource": "db"
|
||||
},
|
||||
"AccessToken": {
|
||||
"dataSource": "db",
|
||||
"public": false
|
||||
},
|
||||
"ACL": {
|
||||
"dataSource": "db",
|
||||
"public": false
|
||||
},
|
||||
"RoleMapping": {
|
||||
"dataSource": "db",
|
||||
"public": false
|
||||
},
|
||||
"Role": {
|
||||
"dataSource": "db",
|
||||
"public": false
|
||||
},
|
||||
"Todo": {
|
||||
"dataSource": "db",
|
||||
"public": true,
|
||||
"options": {
|
||||
"remoting": {
|
||||
"sharedMethods": {
|
||||
"*": false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
var boot = require('loopback-boot');
|
||||
var loopback = require('../../../../../index');
|
||||
|
||||
var app = module.exports = loopback();
|
||||
boot(app, __dirname);
|
||||
app.use(loopback.rest());
|
|
@ -0,0 +1,3 @@
|
|||
module.exports = function(Todo) {
|
||||
|
||||
};
|
18
test/fixtures/shared-methods/model-config-default-true/common/models/todo.json
vendored
Normal file
18
test/fixtures/shared-methods/model-config-default-true/common/models/todo.json
vendored
Normal file
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
"name": "Todo",
|
||||
"base": "PersistedModel",
|
||||
"idInjection": true,
|
||||
"options": {
|
||||
"validateUpsert": true
|
||||
},
|
||||
"properties": {
|
||||
"content": {
|
||||
"type": "string",
|
||||
"required": true
|
||||
}
|
||||
},
|
||||
"validations": [],
|
||||
"relations": {},
|
||||
"acls": [],
|
||||
"methods": {}
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
{
|
||||
"restApiRoot": "/api",
|
||||
"host": "0.0.0.0",
|
||||
"port": 3000,
|
||||
"remoting": {
|
||||
"context": {
|
||||
"enableHttpContext": false
|
||||
},
|
||||
"rest": {
|
||||
"normalizeHttpPath": false,
|
||||
"xml": false
|
||||
},
|
||||
"json": {
|
||||
"strict": false,
|
||||
"limit": "100kb"
|
||||
},
|
||||
"urlencoded": {
|
||||
"extended": true,
|
||||
"limit": "100kb"
|
||||
},
|
||||
"cors": false,
|
||||
"errorHandler": {
|
||||
"disableStackTrace": false
|
||||
}
|
||||
},
|
||||
"legacyExplorer": false
|
||||
}
|
||||
|
6
test/fixtures/shared-methods/model-config-default-true/server/datasources.json
vendored
Normal file
6
test/fixtures/shared-methods/model-config-default-true/server/datasources.json
vendored
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"db": {
|
||||
"name": "db",
|
||||
"connector": "memory"
|
||||
}
|
||||
}
|
46
test/fixtures/shared-methods/model-config-default-true/server/model-config.json
vendored
Normal file
46
test/fixtures/shared-methods/model-config-default-true/server/model-config.json
vendored
Normal file
|
@ -0,0 +1,46 @@
|
|||
{
|
||||
"_meta": {
|
||||
"sources": [
|
||||
"loopback/common/models",
|
||||
"loopback/server/models",
|
||||
"../common/models",
|
||||
"./models"
|
||||
],
|
||||
"mixins": [
|
||||
"loopback/common/mixins",
|
||||
"loopback/server/mixins",
|
||||
"../common/mixins",
|
||||
"./mixins"
|
||||
]
|
||||
},
|
||||
"User": {
|
||||
"dataSource": "db"
|
||||
},
|
||||
"AccessToken": {
|
||||
"dataSource": "db",
|
||||
"public": false
|
||||
},
|
||||
"ACL": {
|
||||
"dataSource": "db",
|
||||
"public": false
|
||||
},
|
||||
"RoleMapping": {
|
||||
"dataSource": "db",
|
||||
"public": false
|
||||
},
|
||||
"Role": {
|
||||
"dataSource": "db",
|
||||
"public": false
|
||||
},
|
||||
"Todo": {
|
||||
"dataSource": "db",
|
||||
"public": true,
|
||||
"options": {
|
||||
"remoting": {
|
||||
"sharedMethods": {
|
||||
"*": true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
var boot = require('loopback-boot');
|
||||
var loopback = require('../../../../../index');
|
||||
|
||||
var app = module.exports = loopback();
|
||||
boot(app, __dirname);
|
||||
app.use(loopback.rest());
|
3
test/fixtures/shared-methods/model-config-defined-false/common/models/todo.js
vendored
Normal file
3
test/fixtures/shared-methods/model-config-defined-false/common/models/todo.js
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
module.exports = function(Todo) {
|
||||
|
||||
};
|
18
test/fixtures/shared-methods/model-config-defined-false/common/models/todo.json
vendored
Normal file
18
test/fixtures/shared-methods/model-config-defined-false/common/models/todo.json
vendored
Normal file
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
"name": "Todo",
|
||||
"base": "PersistedModel",
|
||||
"idInjection": true,
|
||||
"options": {
|
||||
"validateUpsert": true
|
||||
},
|
||||
"properties": {
|
||||
"content": {
|
||||
"type": "string",
|
||||
"required": true
|
||||
}
|
||||
},
|
||||
"validations": [],
|
||||
"relations": {},
|
||||
"acls": [],
|
||||
"methods": {}
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
{
|
||||
"restApiRoot": "/api",
|
||||
"host": "0.0.0.0",
|
||||
"port": 3000,
|
||||
"remoting": {
|
||||
"context": {
|
||||
"enableHttpContext": false
|
||||
},
|
||||
"rest": {
|
||||
"normalizeHttpPath": false,
|
||||
"xml": false
|
||||
},
|
||||
"json": {
|
||||
"strict": false,
|
||||
"limit": "100kb"
|
||||
},
|
||||
"urlencoded": {
|
||||
"extended": true,
|
||||
"limit": "100kb"
|
||||
},
|
||||
"cors": false,
|
||||
"errorHandler": {
|
||||
"disableStackTrace": false
|
||||
}
|
||||
},
|
||||
"legacyExplorer": false
|
||||
}
|
||||
|
6
test/fixtures/shared-methods/model-config-defined-false/server/datasources.json
vendored
Normal file
6
test/fixtures/shared-methods/model-config-defined-false/server/datasources.json
vendored
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"db": {
|
||||
"name": "db",
|
||||
"connector": "memory"
|
||||
}
|
||||
}
|
46
test/fixtures/shared-methods/model-config-defined-false/server/model-config.json
vendored
Normal file
46
test/fixtures/shared-methods/model-config-defined-false/server/model-config.json
vendored
Normal file
|
@ -0,0 +1,46 @@
|
|||
{
|
||||
"_meta": {
|
||||
"sources": [
|
||||
"loopback/common/models",
|
||||
"loopback/server/models",
|
||||
"../common/models",
|
||||
"./models"
|
||||
],
|
||||
"mixins": [
|
||||
"loopback/common/mixins",
|
||||
"loopback/server/mixins",
|
||||
"../common/mixins",
|
||||
"./mixins"
|
||||
]
|
||||
},
|
||||
"User": {
|
||||
"dataSource": "db"
|
||||
},
|
||||
"AccessToken": {
|
||||
"dataSource": "db",
|
||||
"public": false
|
||||
},
|
||||
"ACL": {
|
||||
"dataSource": "db",
|
||||
"public": false
|
||||
},
|
||||
"RoleMapping": {
|
||||
"dataSource": "db",
|
||||
"public": false
|
||||
},
|
||||
"Role": {
|
||||
"dataSource": "db",
|
||||
"public": false
|
||||
},
|
||||
"Todo": {
|
||||
"dataSource": "db",
|
||||
"public": true,
|
||||
"options": {
|
||||
"remoting": {
|
||||
"sharedMethods": {
|
||||
"find": false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
var boot = require('loopback-boot');
|
||||
var loopback = require('../../../../../index');
|
||||
|
||||
var app = module.exports = loopback();
|
||||
boot(app, __dirname);
|
||||
app.use(loopback.rest());
|
|
@ -0,0 +1,3 @@
|
|||
module.exports = function(Todo) {
|
||||
|
||||
};
|
18
test/fixtures/shared-methods/model-config-defined-true/common/models/todo.json
vendored
Normal file
18
test/fixtures/shared-methods/model-config-defined-true/common/models/todo.json
vendored
Normal file
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
"name": "Todo",
|
||||
"base": "PersistedModel",
|
||||
"idInjection": true,
|
||||
"options": {
|
||||
"validateUpsert": true
|
||||
},
|
||||
"properties": {
|
||||
"content": {
|
||||
"type": "string",
|
||||
"required": true
|
||||
}
|
||||
},
|
||||
"validations": [],
|
||||
"relations": {},
|
||||
"acls": [],
|
||||
"methods": {}
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
{
|
||||
"restApiRoot": "/api",
|
||||
"host": "0.0.0.0",
|
||||
"port": 3000,
|
||||
"remoting": {
|
||||
"context": {
|
||||
"enableHttpContext": false
|
||||
},
|
||||
"rest": {
|
||||
"normalizeHttpPath": false,
|
||||
"xml": false
|
||||
},
|
||||
"json": {
|
||||
"strict": false,
|
||||
"limit": "100kb"
|
||||
},
|
||||
"urlencoded": {
|
||||
"extended": true,
|
||||
"limit": "100kb"
|
||||
},
|
||||
"cors": false,
|
||||
"errorHandler": {
|
||||
"disableStackTrace": false
|
||||
}
|
||||
},
|
||||
"legacyExplorer": false
|
||||
}
|
||||
|
6
test/fixtures/shared-methods/model-config-defined-true/server/datasources.json
vendored
Normal file
6
test/fixtures/shared-methods/model-config-defined-true/server/datasources.json
vendored
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"db": {
|
||||
"name": "db",
|
||||
"connector": "memory"
|
||||
}
|
||||
}
|
46
test/fixtures/shared-methods/model-config-defined-true/server/model-config.json
vendored
Normal file
46
test/fixtures/shared-methods/model-config-defined-true/server/model-config.json
vendored
Normal file
|
@ -0,0 +1,46 @@
|
|||
{
|
||||
"_meta": {
|
||||
"sources": [
|
||||
"loopback/common/models",
|
||||
"loopback/server/models",
|
||||
"../common/models",
|
||||
"./models"
|
||||
],
|
||||
"mixins": [
|
||||
"loopback/common/mixins",
|
||||
"loopback/server/mixins",
|
||||
"../common/mixins",
|
||||
"./mixins"
|
||||
]
|
||||
},
|
||||
"User": {
|
||||
"dataSource": "db"
|
||||
},
|
||||
"AccessToken": {
|
||||
"dataSource": "db",
|
||||
"public": false
|
||||
},
|
||||
"ACL": {
|
||||
"dataSource": "db",
|
||||
"public": false
|
||||
},
|
||||
"RoleMapping": {
|
||||
"dataSource": "db",
|
||||
"public": false
|
||||
},
|
||||
"Role": {
|
||||
"dataSource": "db",
|
||||
"public": false
|
||||
},
|
||||
"Todo": {
|
||||
"dataSource": "db",
|
||||
"public": true,
|
||||
"options": {
|
||||
"remoting": {
|
||||
"sharedMethods": {
|
||||
"find": true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
var boot = require('loopback-boot');
|
||||
var loopback = require('../../../../../index');
|
||||
|
||||
var app = module.exports = loopback();
|
||||
boot(app, __dirname);
|
||||
app.use(loopback.rest());
|
Loading…
Reference in New Issue