popsicle-server.js
function popsicleServer (app) {
  var server = serverAddress(app)

  return function (req, next) {
    server.listen()

    req.url = server.url(req.url)

    return promiseFinally(next(), function () {
      server.close()
    })
  }
}
function popsicleServer (app) {
  var server = serverAddress(app)

  return function (req, next) {
    server.listen()

    req.url = server.url(req.url)

    return promiseFinally(next(), function () {
      server.close()
    })
  }
}
function popsicleServer ( app ) { var server = serverAddress ( app ) return function ( req , next ) { server . listen ( ) req . url = server . url ( req . url ) return promiseFinally ( next ( ) , function ( ) { server . close ( ) } ) } }
Create a request interceptor that listens and disconnects automatically.

@param  {Function} app
@return {Function}
Create a request interceptor that listens and disconnects automatically .