Skip to content

Commit

Permalink
upate docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Vladimir authored and Vladimir committed Nov 15, 2015
1 parent 460df43 commit 1883b4e
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
node-registry [![NPM version](https://img.shields.io/npm/v/node-registry.svg)](https://img.shields.io/npm/v/node-registry.svg) [![Build Status](https://travis-ci.org/vladaspasic/node-registry.svg?branch=master)](https://travis-ci.org/vladaspasic/node-registry) [![Coverage Status](https://img.shields.io/coveralls/vladaspasic/node-registry.svg)](https://coveralls.io/r/vladaspasic/node-registry)
=============

Node Registry is a IoC Container for `node.js`. Registry helps you to glue your code together and easily manage your dependencies. Building blocks for the Container are `Modules`. You can manage your Module dependecy injections, lifecycle and behavior easily with the Registry support. With this approach you can easily decouple your logic into smaller units of code, this allows you the easily test, refactor and manage each specific part of your server logic.

The point behind the Registry is to be lightweight and independent. So it could be used with any `node.js` framework.
Expand Down Expand Up @@ -57,9 +54,10 @@ var Server = Registry.createServer(app);
Server.start(function() {
console.info('Server running on Port: %d', Server.port);
});

```

Registry API Documentation could be found [here](http://vladaspasic.github.io/node-registry/docs/classes/Registry.html)

## Creating a server

Registry wraps the Node HTTP/HTTPS Server to create an easily configurable server module. The server is then registered inside the container, so you are able to access it everywhere in your code easily.
Expand Down Expand Up @@ -131,6 +129,8 @@ var Server = Registry.createServer({
Server.start();
```

Server API Documentation could be found [here](http://vladaspasic.github.io/node-registry/docs/classes/Server.html)

## Initializers

Initializers are functions that are invoked before we start the Server. This is usefull when you are trying to execute some asyncronous code, like check if the database is running and if you can connect to it. There is no point in starting the server if our database is not there, we should instead notify that is server is unavailable and you should fix this problem first.
Expand Down Expand Up @@ -371,4 +371,5 @@ Registry.registerModule('auth', {
this.environment.getRequired('myKey');
},
});
```
```

0 comments on commit 1883b4e

Please sign in to comment.