Skip to content

Commit

Permalink
fix the code error in readme.md
Browse files Browse the repository at this point in the history
  • Loading branch information
yunnysunny committed Sep 17, 2018
1 parent c26f693 commit a1d460a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# v0.1.0
## Fix
1. Fixed the code error in `readme.md` .

# v0.0.1
## Add
1. Project init.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@yunnysunny/request-logging",
"version": "0.0.1",
"version": "0.1.0",
"description": "Print the express request log to console and save it to kafka when required, and even can send alram message when the response code greater than 500.",
"main": "index.js",
"scripts": {
Expand Down
15 changes: 10 additions & 5 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@

Print the express request log to console and save it to kafka when required, and even can send alram message when the response code greater than 500.

[![npm version][npm-image]][npm-url]
[![build status][travis-image]][travis-url]
[![David deps][david-image]][david-url]
[![Test coverage][coveralls-image]][coveralls-url]
[![node version][node-image]][node-url]

[npm-image]: https://img.shields.io/npm/v/@yunnysunny/request-logging.svg?style=flat
[npm-url]: https://npmjs.org/package/@yunnysunny/request-logging
[travis-image]: https://img.shields.io/travis/yunnysunny/request-log.svg?style=flat-square
[travis-url]: https://travis-ci.org/yunnysunny/request-log
Expand All @@ -17,22 +19,25 @@ Print the express request log to console and save it to kafka when required, and
[coveralls-image]: https://img.shields.io/coveralls/yunnysunny/request-log.svg?style=flat-square
[coveralls-url]: https://coveralls.io/r/yunnysunny/request-log?branch=master

[![NPM](https://nodei.co/npm/@yunnysunny/request-logging.png?downloads=true)](https://nodei.co/npm/@yunnysunny/request-logging)


## Installation
```npm install @yunnysunny/request-logging --save```

## Usage

```javascript
const express = require('express');
const path = require('path');
const bodyParser = require('body-parser');
const requestLog = require('req-log');
const requestLog = require('@yunnysunny/request-logging');

const app = express();
app.enable('trust proxy');

// view engine setup
app.set('port', port);
app.use(requestLog({kafkaSchedule}));
app.use(requestLog());

app.use(bodyParser.json({limit: '1mb'}));
app.use(bodyParser.urlencoded({
Expand All @@ -43,8 +48,8 @@ app.use(bodyParser.urlencoded({

## API

See [api](doc/api.md) document.
See [api](https://github.com/yunnysunny/request-log/blob/HEAD/doc/api.md) document.

## License

[MIT](LICENSE)
[MIT](https://github.com/yunnysunny/request-log/blob/HEAD/LICENSE)

0 comments on commit a1d460a

Please sign in to comment.