Skip to content

Commit e96451b

Browse files
author
Denis Rechkunov
committed
Update readme.
1 parent f6c46ee commit e96451b

1 file changed

Lines changed: 21 additions & 40 deletions

File tree

README.md

Lines changed: 21 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,17 @@
22
[![NPM](https://nodei.co/npm/catberry-uhr.png)](https://nodei.co/npm/catberry-uhr/)
33

44
##Description
5-
Catberry's modules run both at server and browser and it is very useful to have universal http(s) request implementation.
5+
Catberry's modules run both at server and in browser and it is very useful to
6+
have universal http(s) request implementation.
67

7-
It has one interface and different implementations on server and browser.
8+
It has one interface and different implementations at server and in browser.
89

9-
At server it uses node's "http.request" or "https.request" (depend on specified protocol in URL).
10+
At server it uses node's "http.request" or "https.request"
11+
(depend on specified protocol in URL).
1012
At browser it uses native XmlHttpRequest.
1113

12-
This module was developed using [HTTP/1.1v2 RFC 2616](http://www.w3.org/Protocols/rfc2616).
14+
This module was developed using [HTTP/1.1v2 RFC 2616]
15+
(http://www.w3.org/Protocols/rfc2616).
1316

1417
It supports:
1518

@@ -72,6 +75,7 @@ Options support:
7275

7376
```javascript
7477
{
78+
method: 'GET',
7579
timeout: 30000,
7680
headers: {
7781
Cookie: 'name=value'
@@ -106,38 +110,10 @@ Status object looks like this:
106110
```
107111

108112
##Usage
109-
To use this module you must register its components into catberry's [Service Locator](https://github.com/pragmadash/catberry-locator) like this:
113+
If you are using [Catberry Framework](https://github.com/pragmadash/catberry)
114+
it is already included and registered in Service Locator.
110115

111-
In server.js
112-
113-
```javascript
114-
var uhr = require('catberry-uhr'),
115-
catberry = require('catberry'),
116-
config = require('./config-server'),
117-
app = connect();
118-
cat = catberry.create(config);
119-
120-
// register UHR components
121-
uhr.registerOnServer(cat.locator);
122-
123-
app.use(cat.getMiddleware());
124-
...
125-
```
126-
127-
In client.js
128-
129-
```javascript
130-
var uhr = require('catberry-uhr'),
131-
catberry = require('catberry'),
132-
config = require('./config-client'),
133-
cat = catberry.create(config);
134-
135-
// register localization components in locator
136-
uhr.registerOnClient(cat.locator);
137-
138-
```
139-
140-
And then you can just inject $uhr into you module and use like this:
116+
You can just inject $uhr into you module and use like this:
141117

142118
```javascript
143119
function Module($uhr) {
@@ -167,11 +143,16 @@ Module.prototype.render(placeholderName, args, callback) {
167143
```
168144

169145
##Contribution
170-
If you have found a bug, please create pull request with mocha unit-test which reproduces it or describe all details in issue if you can not implement test.
171-
If you want to propose some improvements just create issue or pull request but please do not forget to use **npm test** to be sure that you code is awesome.
146+
If you have found a bug, please create pull request with [mocha]
147+
(https://www.npmjs.org/package/mocha) unit-test which reproduces it or describe
148+
all details in issue if you can not implement test. If you want to propose some
149+
improvements just create issue or pull request but please do not forget to use
150+
`npm test` to be sure that your code is awesome.
172151

173-
All changes should satisfy this [Code Style Guide](https://github.com/pragmadash/catberry/blob/master/docs/code-style.md).
152+
All changes should satisfy this [Code Style Guide]
153+
(docs/code-style-guide.md).
174154

175-
Also your changes should be covered by unit tests using [mocha](https://www.npmjs.org/package/mocha).
155+
Also your changes should be covered by unit tests using [mocha]
156+
(https://www.npmjs.org/package/mocha).
176157

177-
Denis Rechkunov <denis.rechkunov@gmail.com>
158+
Denis Rechkunov <denis.rechkunov@gmail.com>

0 commit comments

Comments
 (0)