From fea17cad7f3a6a099a47262e3da3b3d1242b8961 Mon Sep 17 00:00:00 2001 From: Berkeley Martinez Date: Thu, 25 Jun 2015 23:05:11 -0700 Subject: [PATCH] add initial client config for loopback client --- client/config.json | 8 ++++++++ client/config.local.js | 5 +++++ client/datasources.json | 10 ++++++++++ client/datasources.local.js | 7 +++++++ client/loopbackClient.js | 8 ++++++++ client/model-config.json | 32 ++++++++++++++++++++++++++++++++ 6 files changed, 70 insertions(+) create mode 100644 client/config.json create mode 100644 client/config.local.js create mode 100644 client/datasources.json create mode 100644 client/datasources.local.js create mode 100644 client/loopbackClient.js create mode 100644 client/model-config.json diff --git a/client/config.json b/client/config.json new file mode 100644 index 0000000000..3f5ecb7649 --- /dev/null +++ b/client/config.json @@ -0,0 +1,8 @@ +{ + "restApiRoot": "/api", + "remoting": { + "context": { + "enableHttpContext": false + } + } +} diff --git a/client/config.local.js b/client/config.local.js new file mode 100644 index 0000000000..e5058ced89 --- /dev/null +++ b/client/config.local.js @@ -0,0 +1,5 @@ +var globalConfig = require('../common/config.global'); + +module.exports = { + restApiRoot: globalConfig.restApi +}; diff --git a/client/datasources.json b/client/datasources.json new file mode 100644 index 0000000000..d6d2206bd6 --- /dev/null +++ b/client/datasources.json @@ -0,0 +1,10 @@ +{ + "remote": { + "name": "remote", + "connector": "remote" + }, + "local": { + "name": "local", + "connector": "memory" + } +} diff --git a/client/datasources.local.js b/client/datasources.local.js new file mode 100644 index 0000000000..4f07ba41f3 --- /dev/null +++ b/client/datasources.local.js @@ -0,0 +1,7 @@ +var globalConfig = require('../common/config.global'); + +module.exports = { + remote: { + url: globalConfig.restApiUrl + } +}; diff --git a/client/loopbackClient.js b/client/loopbackClient.js new file mode 100644 index 0000000000..9f860ae72b --- /dev/null +++ b/client/loopbackClient.js @@ -0,0 +1,8 @@ +var loopback = require('loopback'), + boot = require('loopback-boot'); + +var app = loopback(); + +boot(app, __dirname); + +module.exports = app; diff --git a/client/model-config.json b/client/model-config.json new file mode 100644 index 0000000000..61e1e58d3d --- /dev/null +++ b/client/model-config.json @@ -0,0 +1,32 @@ +{ + "_meta": { + "sources": [ + "../common/models", + "./models" + ] + }, + "user": { + "dataSource": "remote" + }, + "bonfire": { + "dataSource": "remote" + }, + "challenge": { + "dataSource": "remote" + }, + "comment": { + "dataSource": "remote" + }, + "fieldGuide": { + "dataSource": "remote" + }, + "job": { + "dataSource": "remote" + }, + "nonprofit": { + "dataSource": "remote" + }, + "story": { + "dataSource": "remote" + } +}