|
|
|
@ -33,9 +33,9 @@ class ServeController extends Controller
|
|
|
|
|
public $port = 8080; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @var string path to directory to serve |
|
|
|
|
* @var string path or path alias to directory to serve |
|
|
|
|
*/ |
|
|
|
|
public $docroot = 'web'; |
|
|
|
|
public $docroot = '@app/web'; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @var string path to router script. |
|
|
|
@ -52,8 +52,7 @@ class ServeController extends Controller
|
|
|
|
|
*/ |
|
|
|
|
public function actionIndex($address = 'localhost') |
|
|
|
|
{ |
|
|
|
|
$basePath = Yii::$app->basePath; |
|
|
|
|
$documentRoot = $basePath . '/' . $this->docroot; |
|
|
|
|
$documentRoot = Yii::getAlias($this->docroot); |
|
|
|
|
|
|
|
|
|
if (strpos($address, ':') === false) { |
|
|
|
|
$address = $address . ':' . $this->port; |
|
|
|
|