Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 55 lines (38 sloc) 1.624 kb
a8394465 »
2012-09-10 Initial commit
1
2 # jog-middleware
3
4 jog json logger middleware for Connect / Express
5
6 ## Installation
7
8 $ npm install jog-middleware
9
10 ## Example
11
12 ```js
13 var connect = require('connect');
14 var logger = require('./index');
15 var jog = require('jog');
16 var log = jog(new jog.FileStore('/tmp/log'));
17
18 var app = connect();
19
20 app.use(logger(log));
21
22 app.use(function(req, res){
23 res.statusCode = 200;
24 res.setHeader('Content-Type', 'application/json');
25 res.end(JSON.stringify({ message: 'Hello' }));
26 });
27
28 app.listen(3000);
29
30 ```
31
32 ## License
33
34 (The MIT License)
35
36 Copyright (c) 2012 TJ Holowaychuk <tj@vision-media.ca>
37
38 Permission is hereby granted, free of charge, to any person obtaining
39 a copy of this software and associated documentation files (the
40 'Software'), to deal in the Software without restriction, including
41 without limitation the rights to use, copy, modify, merge, publish,
42 distribute, sublicense, and/or sell copies of the Software, and to
43 permit persons to whom the Software is furnished to do so, subject to
44 the following conditions:
45
46 The above copyright notice and this permission notice shall be
47 included in all copies or substantial portions of the Software.
48
49 THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
50 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
51 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
52 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
53 CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
54 TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
55 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Something went wrong with that request. Please try again.