1.配置config/modules.php
'healthy' => 'backend\modules\healthy\Module',
2.填写modules请求文件
2.1 在目录backend/modules/healthy/
创建Module.php,写入以下内容
<?php
namespace backend\modules\healthy;
/**
* workorder module definition class
*/
class Module extends \yii\base\Module
{
/**
* @inheritdoc
*/
public $controllerNamespace = 'backend\modules\healthy\controllers';
public $defaultRoute = '';
/**
* @inheritdoc
*/
public function init()
{
parent::init();
}
}
2.2 在目录backend/modules/healthy/controllers
创建HeartbeatController.php
文件,写入以下内容
<?php
namespace backend\modules\healthy\controllers;
use yii\web\Controller;
class HeartbeatController extends Controller {
public function actionCheck(){
echo 'App heartbeat check.';exit(200);
}
}
2.3 使用postman请求
期待大家点赞支持