반응형
Route::post('/users', [UserController::class, 'createUser']); routes/api.php 파일에 위의 코드를 추가해줍니다.
root@webgori-1:~# apt update && apt -y install wrk Reading package lists... Done Building dependency tree... Done Reading state information... Done The following additional packages will be installed: libluajit-5.1-2 libluajit-5.1-common The following NEW packages will be installed: libluajit-5.1-2 libluajit-5.1-common wrk 0 upgraded, 3 newly installed, 0 to remove and 60 not upgraded. Need to g..
# host에서 container로 진입 root@webgori-1:~# docker exec -it mariadb bash root@1923623486a6:/# vi /etc/mysql/conf.d/log.cnf [mysqld] general_log = ON general_log_file=/var/log/mysql/query.log :wq # host로 나와서 container 재시작 root@webgori-1:~# docker restart mariadb # 로그를 확인하기 위해서 host에서 container로 진입 root@webgori-1:~# docker exec -it mariadb bash # 로그 확인 root@1923623486a6:/# tail -f /var/log/mysql/quer..
client가 Request를 보내면 글로벌 미들웨어에서 처리할게 있으면 처리하고, 라우터에 도착합니다. 라우터에서는 정의되어있는 Request URL을 확인한 후 구현된 부분을 처리하게 되는데, 라우터에 미들웨어가 정의되어 있다면 미들웨어를 거쳐서 Controller로 가게 됩니다. 미들웨어를 지정하지 않았다면 바로 Controller로 가거나 View로 갑니다. (라우터에서 어떻게 구현했냐에 따라 다름. 보통 웹페이지의 경우 Controller -> View, API의 경우 Controller에서 모델 조회 후 Return) 자세한 설명은 이곳을 참고해주세요. 이해를 돕기 위한 이미지 출처는 이곳입니다.