def app
      # Setup the rack server and adaptor
      RackServerAdaptor.load

      app = Rack::Builder.new

      # Handle websocket connections
      app.use WebsocketHandler

      can_fork = Process.respond_to?(:fork)

      unless can_fork
        Volt.logger.warn('Code reloading in Volt currently depends on `fork`.  Your environment does not support `fork`.  We\'re working on adding more reloading strategies.  For now though you\'ll need to restart the server manually on changes, which sucks.  Feel free to complain to the devs, we really let you down here. :-)')
      end

      # Only run ForkingServer if fork is supported in this env.
      # NO_FORKING can be used to specify that you don't want to use the forking
      # server.
      if !can_fork || Volt.env.production? || Volt.env.test? || ENV['NO_FORKING']
        # In production/test, we boot the app and run the server
        #
        # Sometimes the app is already booted, so we can skip if it is
        boot_volt unless @volt_app

        # Setup the dispatcher (it stays this class during its run)
        SocketConnectionHandler.dispatcher = Dispatcher.new(@volt_app)
        app.run(@volt_app.middleware)
      else
        # In developer
        app.run ForkingServer.new(self)
      end

      app
    end
def app
      # Setup the rack server and adaptor
      RackServerAdaptor.load

      app = Rack::Builder.new

      # Handle websocket connections
      app.use WebsocketHandler

      can_fork = Process.respond_to?(:fork)

      unless can_fork
        Volt.logger.warn('Code reloading in Volt currently depends on `fork`.  Your environment does not support `fork`.  We\'re working on adding more reloading strategies.  For now though you\'ll need to restart the server manually on changes, which sucks.  Feel free to complain to the devs, we really let you down here. :-)')
      end

      # Only run ForkingServer if fork is supported in this env.
      # NO_FORKING can be used to specify that you don't want to use the forking
      # server.
      if !can_fork || Volt.env.production? || Volt.env.test? || ENV['NO_FORKING']
        # In production/test, we boot the app and run the server
        #
        # Sometimes the app is already booted, so we can skip if it is
        boot_volt unless @volt_app

        # Setup the dispatcher (it stays this class during its run)
        SocketConnectionHandler.dispatcher = Dispatcher.new(@volt_app)
        app.run(@volt_app.middleware)
      else
        # In developer
        app.run ForkingServer.new(self)
      end

      app
    end
App returns the main rack app.  In development it will use ForkingServer,
 which forks the app and processes responses in a child process, that is
 killed when code changes and reforked.  (This provides simple fast code
 reloading)