Skip to content

Commit 9e3ac87

Browse files
committed
another trial to make test pass on travis
1 parent 48941f4 commit 9e3ac87

File tree

4 files changed

+6
-9
lines changed

4 files changed

+6
-9
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ before_script:
2020
install:
2121
- npm install
2222
script:
23+
- npm start
2324
- >-
2425
istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec
2526
&& codecov

app.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ if(config.env === 'production'){
4141
}
4242

4343

44-
var server = app.listen(config.port,'0.0.0.0', function () {
44+
var server = app.listen(config.port, function () {
4545
var host = server.address().address;
4646
var port = server.address().port;
47-
log.info('listening on host '+host+', port '+config.port+'!');
47+
log.info('listening on host '+host+', port '+port+'!');
4848
});
4949

5050
}

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"description": "A template for creating APIs Fast",
55
"main": "app.js",
66
"scripts": {
7-
"test": "gulp sanity"
7+
"test": "gulp sanity",
8+
"start": "node app"
89
},
910
"repository": {
1011
"type": "git",

test/routes/index.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@ var express = require('express');
1212

1313
var app = express();
1414
app.use('/',router);
15-
var server = app.listen(config.port,'0.0.0.0', function () {
16-
var host = server.address().address;
17-
var port = server.address().port;
18-
console.log('listening on host '+host+', port '+config.port+'!');
19-
});
2015

2116
// init
2217

@@ -57,7 +52,7 @@ var server = app.listen(config.port,'0.0.0.0', function () {
5752

5853
// req.method = '';
5954

60-
var agent = request.agent(app);
55+
var agent = request.agent('http://0.0.0.0:'+config.port+'');
6156

6257
describe('Test rate limiting', function(){
6358

0 commit comments

Comments
 (0)