sugar-boot is an little express bootstrap managing dependency injections and routes directly inside of classes.
Current status
Alpha version, creation on 18/09/15. There will be more in the near future.
Should be used with es6 babel
How it works
The sugar-boot module will look inside of a dist folder, to find components and routers. It then add them inside of an injector through di-injector and manage the application through this.
It's just an alpha, but feel free to try it and to me a feedback :-).
Creation of a controller, Billing for example :
{ thisbillingService = billingService; } { res; } /* Allow Billing class to be injected or to inject some other objects */BillingComponent = true; /* Require an instance of BillingService in the constructor, based on di-injector external module */BillingdiConstructor = 'BillingService'; /* Tell /path with the concerned verb and the callback method (of the current class) */BillingRoutes = verb:'get' path:'/billings' callback:'getAll'; ;
Creation of a service like this BillingService :
{ return id:1title:"First billing"id:2title:"Second billing"; } /* Allow BillingService class to be injected or to inject some other objects */BillingServiceComponent = true;;
Creation of the application
The default one :
/* Require the sugar-boot */var boot = ; /* Boot the express server and watch inside of the dist folder to find components or routers */boot;
The most advanced one :
/* Require the sugar-boot */var boot = ; /* Binding librairie for external injection */var binding = Binding; /* Boot the express server and watch inside of the dist folder to find components or routers, except in the dist/repo-not-needed */boot;