Skip to content

Commit

Permalink
Can access express;
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxime Magné committed Dec 17, 2019
1 parent 4e8df6f commit ab87071
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# HearthJS

### v2.0.1
- Can access express from hearthjs module

### v2.0.0
- Add dynamic command

Expand Down
2 changes: 2 additions & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ const cron = require('./cron')
const t = require('./translate').t
const logger = require('./logger')
const testClient = require('./testClient')
const express = require('express')

const hearth = {
server: server,
express: express,
api: api,
db: db,
converter: converter,
Expand Down
6 changes: 3 additions & 3 deletions lib/testClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,21 +55,21 @@ class TestClient {
post (route, jsonData, callback) {
request.post({
url: this.getCompleteUrl(route),
form: jsonData,
json: jsonData,
headers: this.getHeaders()
}, (err, response, body) => {
if (err) {
return callback(err)
}

this._parseBody(response, body, callback)
return callback(null, response, body)
})
}

put (route, jsonData, callback) {
request.put({
url: this.getCompleteUrl(route),
form: jsonData,
json: jsonData,
headers: this.getHeaders()
}, (err, response, body) => {
if (err) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hearthjs",
"version": "2.0.0",
"version": "2.0.1",
"description": "A NodeJS server framework to build fast Rest API",
"main": "lib/index.js",
"bin": "bin/hearthjs",
Expand Down

0 comments on commit ab87071

Please sign in to comment.