     if @servers[port]
       @sendError("Port #{port} already in use")
       return
-    server = express()
     try
-      server.listen(port)
-      @servers[port] = server
+      app = express()
+      server = app.listen(port)
+      @servers[port] =
+        app: app
+        server: server
+      if @outPorts.app.isAttached()
+        @outPorts.app.send(app)
+        @outPorts.app.disconnect()
       if @outPorts.server.isAttached()
         @outPorts.server.send(server)
         @outPorts.server.disconnect()

      listen: new noflo.Port 'number'
      close: new noflo.Port 'number'
    @outPorts =
      server: new noflo.Port 'object'
      error: new noflo.Port 'object'


    unless @servers[port]
      @sendError("Port #{port} not listened to")
      return
    @servers[port].server.close()
    delete @servers[port]

  shutdown: ->
