Skip to content

Commit 9310bce

Browse files
committed
readme: fix api example #36
1 parent 2d3d122 commit 9310bce

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog: HTTP Status
22

3+
## Trunk
4+
5+
* readme: fix api example
6+
37
## Version 1.4.0
48

59
* codes: add status code classes

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ console.info(status[500]);
101101
console.info(status[status.INTERNAL_SERVER_ERROR]);
102102
// Both output: "Internal Server Error"
103103

104-
console.info(status['500_CODE']);
105-
console.info(status[`${status.INTERNAL_SERVER_ERROR}_CODE`]);
104+
console.info(status['500_NAME']);
105+
console.info(status[`${status.INTERNAL_SERVER_ERROR}_NAME`]);
106106
// Both output: "INTERNAL_SERVER_ERROR"
107107

108108
console.info(status['500_MESSAGE']);

samples/api.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const status = require('http-status');
1+
const status = require('..');
22

33
console.info(status.INTERNAL_SERVER_ERROR);
44
// Output: 500
@@ -7,8 +7,8 @@ console.info(status[500]);
77
console.info(status[status.INTERNAL_SERVER_ERROR]);
88
// Both output: "Internal Server Error"
99

10-
console.info(status['500_CODE']);
11-
console.info(status[`${status.INTERNAL_SERVER_ERROR}_CODE`]);
10+
console.info(status['500_NAME']);
11+
console.info(status[`${status.INTERNAL_SERVER_ERROR}_NAME`]);
1212
// Both output: "INTERNAL_SERVER_ERROR"
1313

1414
console.info(status['500_MESSAGE']);
@@ -17,4 +17,4 @@ console.info(status[`${status.INTERNAL_SERVER_ERROR}_MESSAGE`]);
1717

1818
console.info(status['500_CLASS']);
1919
console.info(status[`${status.INTERNAL_SERVER_ERROR}_CLASS`]);
20-
// Both output: "5xx"
20+
// Both output: "5xx"

samples/express.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const express = require('express'),
22
redis = require('redis'),
3-
status = require('http-status');
3+
status = require('..');
44
// New Express HTTP server
55
const app = express.createServer();
66
// Regster a route

0 commit comments

Comments
 (0)