Reputation: 695
I'm new to web deployment. Can anyone tell / show me the steps I have to make to deploy my ember cli app to GoDaddy? If in anyway GoDaddy does not support ember cli app, is there a way like some sort of like the java files that can be compiled or something like that in ember to be able to deploy it in any hosting site? If so, please enlighten me.
Upvotes: 4
Views: 1852
Reputation: 25287
You'll probably also want gzip compression: https://medium.com/@bryan.hughes/how-to-enable-compression-on-godaddy-shared-linux-server-deflate-gzip-44f2ab58d0ad#.9yod714no and this rewrite rule https://gist.github.com/dehuszar/68a18367f7e9fa6fb127 (found by searching https://www.google.com/search?q=ember+cli+where+to+put+.htaccess+file)
Added into [your-app]/public/.htaccess
# place in [your-app]/public so it gets compiled into the dist folder
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
# If you get 404 error, uncomment and change the line below.
#RewriteBase /
RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.html [L]
</IfModule>
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
<files *.html>
SetOutputFilter DEFLATE
</files>
<files *.svg>
SetOutputFilter DEFLATE
</files>
I didn't worry about gziping the index.html. See the article on medium.com for that.
I also use ember-cli-deploy with ember-cli-deploy-build and ember-cli-deploy-ftp, but not ember-cli-deploy-gzip at this time. I also had to uninstall ember-cli-sri because of a strange error in the console about some SHA integrity hash check on my js and css files. At first ember-cli-favicon worked to generate my initial favicons, but then stopped working and I had to uninstall it. These tools are pretty easy to setup, but I'll let you navigate your way through setting them up, in case the docs change.
Upvotes: 0
Reputation: 1293
Ember-CLI app can be deployed to any hosting site as the web server only has to serve static content, generated by executing
ember build --environment=production
This command packages all required files for the application into /dist
folder.
From there, all you need to do is to copy the contents of the /dist
folder to a web server and configure it to serve the contents of this folder.
For browser history to work properly, you should also setup web server to serve all routes with index.html file (see example for Apache server)
Upvotes: 7
Reputation: 938
Run $ ember build --environment=production
This will compile a production version of your app. Your server needs to be able to serve your index.html file. Beyond that there are no requirements.
Upvotes: 3