章节目录
【第一篇Laravel10安装】Laravel10 + Vue3.0前后端分离框架通用后台源码
①
vscode 打开 laravel10-vue3-admin
②
routes/web.php
③
新增如下代码
Route::get('/hello', function () {
echo "hello";
});
④
运行效果,36s
⑤
分析性能,简单hello
都要36s。连接数据库,加上代码逻辑。估计要100s+呢。由于之前采用的是,php artisan serve,这边换ngnix环境尝试一下,看一下访问速度是否有变化
⑥
配置ngnix
打开file:///usr/local/etc/nginx/servers/laravel10-vue3.notestore.cn
文件没有则新建哦
内容如下:
server {
listen 80;
server_name laravel10-vue3.notestore.cn;
index index.html index.php;
root /Users/beichen/Documents/laravel10-vue3-admin/backend/public;
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
location / {
try_files $uri $uri/ /index.php$is_args$query_string;
}
}
⑦
重启ngnix服务brew services restart nginx
⑧
进入/etc
⑨
hosts文件,新增如下
127.0.0.1 laravel10-vue3.notestore.cn
⑩
效果如下,38s。好像变化不大,访问依旧很慢,晚点连接数据库,测试一下性能
点我购买,【小编推荐】Laravel10 + Vue3.0前后端分离框架通用后台源码(正版源码,自动发货)
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。