ccarruitero/makemehapi

makemehapi ECONNREFUSED error

Closed this issue · 4 comments

Same problem as #98.

I'm getting this error on the "handling" exercise. I tried some of the solutions from #98, setting the delay to 2000 in the exercise.js file. Which is located in

/usr/lib/node_modules/makemehapi/exercises/handling/exercise.js.
    setTimeout(query.bind(this, mode), 2000);

It seems to fix the issue but I'm now getting a new error.

✗ Status code 404 returned from url http://localhost:52109, expected 200.

# FAIL

Your solution to HANDLING didn't pass. Try again!

this is my solution to the exercise, not sure what I'm doing wrong or if this is another issue?

var Hapi = require('hapi');
var Path = require('path')
var server = new Hapi.Server()

server.connection({
    host: 'localhost',
    port: Number(process.argv[2] || 8080)
})

server.route({
    method: 'GET',
    path: '/',
    handler: { 
        file: Path.join(__dirname, 'index.html')
    }
});

server.start();

I still have the same issue on both the routes and hello_hapi exercises, and I have makemehapi 1.0.3, with the timeout set to 2000 in both of those exercises. If I run it over and over, it eventually passes. Not sure if it's the timeout at all. It seems to be more about the port, perhaps?

That's what it sounds like. I will take a look today.

On Feb 26, 2015, at 8:25 AM, Sam notifications@github.com wrote:

I still have the same issue on both the routes and hello_hapi exercises, and I have makemehapi 1.0.3, with the timeout set to 2000 in both of those exercises. If I run it over and over, it eventually passes. Not sure if it's the timeout at all. It seems to be more about the port, perhaps?


Reply to this email directly or view it on GitHub.

@nvcexploder Did you check this out?

@mhawila Can you try running the Hello Hapi exercise from my fork at
fiveisprime/makemehapi? You can $ npm install -g fiveisprime/makemehapi

I've added some code to the Hello Hapi exercise to make sure that an available
port is used rather than a random port in a range. If that works out, I'll get all of
the exercises updated to use this port selection method.