lib/yarrow/server.rb
##
# Builds a Rack application to serve files in the output directory.
#
# If no output directory is specified, defaults to the current working
# directory.
#
# `auto_index` and `live_reload` middleware needs to run in the specific order
# which is hardcoded here.
#
# @return [Yarrow::Server::StaticFiles]
Builds a Rack application to serve files in the output directory.
If no output directory is specified, defaults to the current working
directory.

`auto_index` and `live_reload` middleware needs to run in the specific order
which is hardcoded here.
Builds a Rack application to serve files in the output directory . If no output directory is specified defaults to the current working directory . ` auto_index ` and ` live_reload ` middleware needs to run in the specific order which is hardcoded here .
def app
      app = Rack::Builder.new
      middleware_stack.each do |middleware|
        app.use(middleware)
      end
      app.use(DirectoryIndex, root: docroot, index: default_index)
      app_args = [docroot, {}].tap { |args| args.push(default_type) if default_type }
      static_app = Rack::File.new(*app_args)
      if live_reload?
        require 'rack-livereload'
        app.use(Rack::LiveReload, no_swf: true)
      end
      if auto_index?
        app.run(Rack::Directory.new(docroot, static_app))
      else
        app.run(static_app)
      end
      app
    end
def app app = Rack :: Builder . new middleware_stack . each do | middleware | app . use ( middleware ) end app . use ( DirectoryIndex , root : docroot , index : default_index ) app_args = [ docroot , { } ] . tap { | args | args . push ( default_type ) if default_type } static_app = Rack :: File . new ( * app_args ) if live_reload? require 'rack-livereload' app . use ( Rack :: LiveReload , no_swf : true ) end if auto_index? app . run ( Rack :: Directory . new ( docroot , static_app ) ) else app . run ( static_app ) end app end
Builds a Rack application to serve files in the output directory.
Builds a Rack application to serve files in the output directory .
None
Yarrow::Server::StaticFiles