Class: Middleman::Cli::Server

Inherits:
Thor::Group
  • Object
show all
Defined in:
middleman-cli/lib/middleman-cli/server.rb

Overview

Server thor task

Instance Method Summary collapse

Instance Method Details

#serverObject

Start the server


36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'middleman-cli/lib/middleman-cli/server.rb', line 36

def server
  require 'middleman-core'
  require 'middleman-core/preview_server'

  unless ENV['MM_ROOT']
    puts '== Could not find a Middleman project config.rb'
    exit
  end

  params = {
    debug: options['verbose'],
    instrumenting: options['instrument'],
    reload_paths: options['reload_paths'],
    daemon: options['daemon']
  }

  puts '== The Middleman is loading'
  ::Middleman::PreviewServer.start(params, options)
end