   getScriptTags = null
 
 
-
-
+  # List of functions that are ran when the app starts listening a port.
+  runOnListen = []
+
+
+  # Run when app starts listening a port
+  app.on 'listening', ->
+    fn() for fn in runOnListen
 
 
   # Collect shared variables and code and wrap them in a closure for browser


      # All js code will be shared from here in production
      app.get "/managedjs/production.js", (req, res) ->
        # Cache for a year. Server restarts will reset the cache.
        res.setHeader 'Cache-Control', 'public, max-age=31556926'
        res.send productionClientCode, 'Content-Type': 'application/javascript'


            




  return app
