I would like to deploy my vue application on shared hosting server. How should I do it? Its a bit confusing as of now. Will I need express js for it or I can directly upload it like the normal html site?
I just did this and I had to check out several resources so I'm gonna put it all here, to save someone else.The following worked for me:
Run "npm run build"
Your assets should be in a "static" folder
Upload your index.html and all files in the /dist
and /static
folder to the directory (public_html or the directory of your sub domain, if its one)
Done!!
P.S You most likely would run into 404 errors when you reload pages of the deployed app, not to worry, just include a .htaccess file which has this configuration:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.html [L]
</IfModule>
AND THEN YOU'RE GOOD!! I hope this helps.