-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how and where to look for resources #27
Comments
Related #28 |
There are a few competing factors here in the API
|
There are a few possible solutions.
3 seems to be the best choice. All resources will be npm packages. The code would look something like: #!/usr/bin/env node
var resource = require('resource');
var admin = resource.use('admin');
resource.use('account', { datasource: "fs"});
resource.use('creature', { datasource: "fs"});
admin.on('init', function() {
admin.start(function (err, server) {
var address = server.address();
resource.logger.info('admin server started on http://' + address.address + ":" + address.port + "/admin")
resource.logger.help('username and password are admin');
});
}); There could also be an aggregate This same approach should work well in the browser as well. The core problem that needs to get solved is the fact we are doing remote dependency installation at run-time. This operation is inherently an asynchronous event, and without a reliable |
This is solved in version 5. I've opted out of async loading of resource dependencies and ready states. The easiest way in development is to use option 2, require that all resources are explicitly defined before application start.
|
this is something that needs to be finalized, implemented, and tested, so here's what i am thinking so far.
install (async):
npm install
to appDir + '/node_modules/'npm install
resource package from npm registryuse (async):
load (sync):
The text was updated successfully, but these errors were encountered: