feat : 오류 발생시 슬랙으로 전송
This commit is contained in:
@@ -1,14 +1,18 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Foundation\Application;
|
||||
use Illuminate\Foundation\Configuration\Exceptions;
|
||||
use Illuminate\Foundation\Configuration\Middleware;
|
||||
use Illuminate\Foundation\Configuration\Exceptions;
|
||||
|
||||
use Illuminate\Contracts\Debug\ExceptionHandler;
|
||||
use App\Exceptions\Handler;
|
||||
|
||||
use App\Http\Middleware\CorsMiddleware;
|
||||
use App\Http\Middleware\ApiKeyMiddleware;
|
||||
use App\Http\Middleware\CheckSwaggerAuth;
|
||||
use App\Http\Middleware\CheckPermission;
|
||||
|
||||
return Application::configure(basePath: dirname(__DIR__))
|
||||
$app = Application::configure(basePath: dirname(__DIR__))
|
||||
->withRouting(
|
||||
web: __DIR__.'/../routes/web.php',
|
||||
api: __DIR__.'/../routes/api.php',
|
||||
@@ -16,18 +20,20 @@
|
||||
health: '/up',
|
||||
)
|
||||
->withMiddleware(function (Middleware $middleware) {
|
||||
|
||||
// CORS 미들웨어 추가
|
||||
$middleware->append(CorsMiddleware::class);
|
||||
|
||||
$middleware->alias([
|
||||
'auth.apikey' => ApiKeyMiddleware::class, // Api Key 인증 미들웨어
|
||||
'swagger.auth' => CheckSwaggerAuth::class, // Swagger 인증 미들웨어
|
||||
'permission' => CheckPermission::class, // 권한확인 미들웨어
|
||||
'auth.apikey' => ApiKeyMiddleware::class,
|
||||
'swagger.auth' => CheckSwaggerAuth::class,
|
||||
'permission' => CheckPermission::class,
|
||||
]);
|
||||
|
||||
})
|
||||
->withExceptions(function (Exceptions $exceptions) {
|
||||
//
|
||||
})->create();
|
||||
// 이건 비워두세요
|
||||
})
|
||||
->create();
|
||||
|
||||
// 🔥 핵심: create() 이후에 반드시 등록
|
||||
$app->singleton(ExceptionHandler::class, Handler::class);
|
||||
|
||||
return $app;
|
||||
|
||||
Reference in New Issue
Block a user