Fix hapi and nodejs

Applies the same sleep trick used in express to hapi and nodejs