How to use the rc.dev function in rc

To help you get started, we’ve selected a few rc examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github strongloop / loopback-connector-oracle / example / app.js View on Github external
// Copyright IBM Corp. 2013,2018. All Rights Reserved.
// Node module: loopback-connector-oracle
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT

'use strict';

const g = require('strong-globalize')();
const DataSource = require('loopback-datasource-juggler').DataSource;
const config = require('rc')('loopback', {dev: {oracle: {}}}).dev.oracle;

const ds = new DataSource(require('../'), config);

function show(err, models) {
  if (err) {
    console.error(err);
  } else {
    models.forEach(function(m) {
      console.log(m);
    });
  }
}

/*
ds.discoverModelDefinitions({views: true, limit: 20}, show);
github strongloop / loopback-connector-oracle / example / app-sync.js View on Github external
// Copyright IBM Corp. 2013. All Rights Reserved.
// Node module: loopback-connector-oracle
// US Government Users Restricted Rights - Use, duplication or disclosure
// restricted by GSA ADP Schedule Contract with IBM Corp.
'use strict';

var DataSource = require('loopback-datasource-juggler').DataSource;

var config = require('rc')('loopback', {dev: {oracle: {}}}).dev.oracle;

var ds = new DataSource(require('../'), config);

var results = ds.connector.querySync('SELECT * from PRODUCT');
console.log(results);

results = ds.discoverModelDefinitionsSync({views: true, limit: 20});
console.log(results);

results = ds.discoverModelPropertiesSync('PRODUCT');
console.log(results);

results = ds.discoverModelPropertiesSync('INVENTORY_VIEW',
  {owner: 'STRONGLOOP'});
console.log(results);
github strongloop / loopback-connector-mysql / example / app.js View on Github external
// Copyright IBM Corp. 2013,2016. All Rights Reserved.
// Node module: loopback-connector-mysql
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT

'use strict';
var DataSource = require('loopback-datasource-juggler').DataSource;

var config = require('rc')('loopback', {dev: {mysql: {}}}).dev.mysql;

var ds = new DataSource(require('../'), config);

function show(err, models) {
  if (err) {
    console.error(err);
  } else {
    console.log(models);
    if (models) {
      models.forEach(function(m) {
        console.dir(m);
      });
    }
  }
}
github strongloop / loopback-connector-mongodb / example / model.js View on Github external
// Copyright IBM Corp. 2013,2019. All Rights Reserved.
// Node module: loopback-connector-mongodb
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT

'use strict';

const g = require('strong-globalize')();

const DataSource = require('loopback-datasource-juggler').DataSource;

const config = require('rc')('loopback', {dev: {mongodb: {}}}).dev.mongodb;

const ds = new DataSource(require('../'), config);

const Customer = ds.createModel('customer', {
  seq: {type: Number, id: true},
  name: String,
  emails: [{label: String, email: String}],
  age: Number,
});

Customer.destroyAll(function(err) {
  Customer.create(
    {
      seq: 1,
      name: 'John1',
      emails: [

rc

hardwired configuration loader

(BSD-2-Clause OR MIT OR Apach…
Latest version published 7 years ago

Package Health Score

70 / 100
Full package analysis