tuandm / laravue

Admin dashboard for enterprise Laravel applications built by VueJS and Element UI https://laravue.dev
https://laravue.dev
MIT License
2.21k stars 655 forks source link

How to configure DocumentRoot and .env for deployment to production? #355

Open jaturongL opened 1 year ago

jaturongL commented 1 year ago

I configure DocumentRoot as

NameVirtualHost laravue.local:80
<VirtualHost laravue.local:80>
    DocumentRoot C:\Apache24\htdocs\laravue\public
    ServerName laravue.local
    ServerAlias laravue.local

and I configure .env as

SANCTUM_STATEFUL_DOMAINS=localhost,127.0.0.1,localhost:8000,127.0.0.1:8000

BASE_API=/api
LARAVUE_USE_ESLINT=true
LARAVUE_PATH=
MIX_BASE_API="${BASE_API}"
MIX_LARAVUE_PATH="${LARAVUE_PATH}"

I run project for production: npm run production

I open the project in browser with URL http://laravue.local then show login page. But when I login that shows error 404 GET http://laravue.local/api/sanctum/csrf-cookie 404 (Not Found)

@tuandm How to configure DocumentRoot and .env for deployment to production?