Permalink
Browse files

New brainstorm

  • Loading branch information...
1 parent b85cf7b commit e203b9cb8e7b3962074b30140d4afc340b97c382 Sergio Lepore committed Oct 18, 2012
Showing with 49 additions and 49 deletions.
  1. +49 −49 todo.md
View
@@ -1,67 +1,67 @@
Change ASAP:
-"test.my_service": {
- "require": "%app.apps_dir%/Moobin/config/test.js",
- "args": ["%encoding%", "@swig"],
- "calls": {
- "check": [8887]
- }
-}
+ "test.my_service": {
+ "require": "%app.apps_dir%/Moobin/config/test.js",
+ "args": ["%encoding%", "@swig"],
+ "calls": {
+ "check": [8887]
+ }
+ }
change into:
-"test.my_service": {
- "require": "%app.apps_dir%/Moobin/config/test.js",
- "args": ["%encoding%", "@swig"], #argument of constructor
- "calls": { #this methods will be executed in order...
- "first_call": [],
- "second_call": ['param'],
- "third": [],
- "fourth": {
- "args": ["args"],
- "add_as": "another.service"
- }
- },
- "build": {
- "builder_method": ['args'] #this method is the last one executed and has to return the final service. many developers use this technique (in old versions of Express, express.createServer() was the last one before service)
- }
-}
+ "test.my_service": {
+ "require": "%app.apps_dir%/Moobin/config/test.js",
+ "args": ["%encoding%", "@swig"], #argument of constructor
+ "calls": { #this methods will be executed in order...
+ "first_call": [],
+ "second_call": ['param'],
+ "third": [],
+ "fourth": {
+ "args": ["args"],
+ "add_as": "another.service"
+ }
+ },
+ "build": {
+ "builder_method": ['args'] #this method is the last one executed and has to return the final service. many developers use this technique (in old versions of Express, express.createServer() was the last one before service)
+ }
+ }
above implementation allows to do the following:
-{
- "parameters": {
- "server.host": "127.0.0.1",
- "server.port": 3001
- },
+ {
+ "parameters": {
+ "server.host": "127.0.0.1",
+ "server.port": 3001
+ },
- "services": {
- "express": {
- "require": "express",
- "calls": {
- "createServer": {
- "return_set_in": "express.app"
- }
- }
- },
+ "services": {
+ "express": {
+ "require": "express",
+ "calls": {
+ "createServer": {
+ "return_set_in": "express.app"
+ }
+ }
+ },
- "io": {
- "require": "socket.io",
- "build": {
- "listen": ["@express.app"]
- }
- },
+ "io": {
+ "require": "socket.io",
+ "build": {
+ "listen": ["@express.app"]
+ }
+ },
- "redis": {
- "require": "redis"
+ "redis": {
+ "require": "redis"
+ }
+ }
}
- }
-}
/// ---------
-var app = container.get('express.app');
-var express = container.get('express');
+ var app = container.get('express.app');
+ var express = container.get('express');

0 comments on commit e203b9c

Please sign in to comment.