Skip to content

Instantly share code, notes, and snippets.

@nomadster
Created February 19, 2014 15:41
Show Gist options
  • Save nomadster/9094609 to your computer and use it in GitHub Desktop.
Save nomadster/9094609 to your computer and use it in GitHub Desktop.
var _ = require('lodash');
var routingLoaderFunction = require('../lib/Routing-MODIFICATO'); //Prende due argomenti: filename, pathSVC
var routingLoaderParams = []; //Ad esempio il path Service, che comunque ce l'ho nel container ma ora mi manca :)
var routingFiles = ['../test/unit/data/routing-files/minimal.yml'];
//routing-minimal:
// path: /name-and-path-are-mandatory
var routingInternalObject = {}; //L'oggetto che sta dentro il container
//Questo sarà il metodo load della classe Container
_(routingFiles).forEach(function(file){
_.assign(routingInternalObject, routingLoaderFunction.call(this,file,routingLoaderParams) );
})
console.log(routingInternalObject);
//Stampa:
{ 'routing-minimal':
{ name: 'routing-minimal',
path: '/name-and-path-are-mandatory',
methods: [ 'all' ],
args: { params: {} } } }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment