pipe
remoteAddress
set. Why would that be? From the little snooping of the code that I did, I saw that the audit plugin uses req.connection.remoteAddress
- should I manually patch it and use the request-ip
module instead?
@avimar i’m using supertest and tape for functional testing. I’m new to both. I’m running into an issue where the test script will not complete. The actual test runs, but the test script does not conclude. Could restify be holding a connection open?
The Test:
var supertest = require('supertest');
var test = require('tape');
var app = require('../app');
var request = supertest.agent('http://localhost:8080');
test('that fantasy player predictions are returned', function(t){
'use strict';
request
.get(‘/users')
.expect(200)
.expect('Content-type',/json/)
.expect('Content-Encoding', 'gzip')
.end(function(err, res){
t.equal(2 + 3, 5);
t.error(err, 'No error');
t.end(err);
});
});
You can see the tests are evaluating, but then the test stoip and i have to control+c out of the script. Any thoughts?
The output:
ubuntu@ip-123-34-56-567:~/apps/sapiv0$ npm test
> sapi@1.0.0 test /home/ubuntu/apps/sapiv0
> node test | tap-spec
SAPI listening at http://0.0.0.0:8080
that fantasy player predictions are returned
✔ should be equal
✔ No error
I'd like to take a URL pathname and match it to an existing restify route handler and get the params from it. basically URL path matching.
Inputs:
/some/random/value
server.get('/some/random/:path', function() { / / });
Output:
{path: 'value'}
Maybe via some method I don't know that works like:
server.router.match('/some/random/value')