19 maj 2010

Deploying a SproutCore app

So im about to deploy an app, i use sc-build to finalize my app. This gives me a directory under "$PATHTOAPP/tmp/static" this directory is symlinked to where apache reads files.

Here is what i did to make it work:

ln -s $PATHTOAPP/tmp/static/ /var/www/html/static
ln -s $PATHTOAPP/tmp/static/my_app/index.html /var/www/html/myapp.html

It works great BUT it cant fetch my data from the datastore hence i am proxying this in the Buildfile. So i need to tell apache to fetch the data for me by doing the same thing i do in the Buildfile:

RewriteEngine On
RewriteBase /data/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule /mydata http://other-host.com/pathtothedata [P]

this all goes into a .htaccess file or in your serverconfig. For the .htaccess file to work u need to set the option AllowOverride to what u might need, i use AllowOverride All in /etc/httpd/conf/httpd.conf

Now my app works!

Inga kommentarer: