Wildhoney / Magento-on-Angular

Angular.js application using Magento as the backend API
360 stars 120 forks source link

Remove Magento from Git, and use central config file for settings #66

Closed aonic closed 10 years ago

aonic commented 10 years ago

This removes the magento folder from this project. Before you pull down the changes I recommend you do this:

mv ./magento ../
git pull
ln -s ../magento

This will make sure you don't accidently delete your Magento install.

Then edit the new config.json to make sure all the values are correct. You need to run grunt after you edit the config.json to propagate the relevant config values to Angular. Only hand-selected values from the main config.json are copied to the public-facing version of the Config.js file (look at store/js/services/Config.template).

Here is an example of my config.json

{
    "socket": {
        "port": "8888",
        "host": "moa.cloud-ops.net"
    },
    "magento": {
        "path": "/var/www/magento",
        "host": "http://moa.cloud-ops.net/magento",
        "store": "0"
    },
    "api": {
        "host": "http://moa.cloud-ops.net/api/public",
        "provider": "magento"
    }
}

Ideally users of this project would make separate vhosts to the Magento instance, a separate vhost to the /api/public folder, and a separate vhost to the /store/ folder. And update the config.json with the new host/paths.

Example of Preferred Setup

(vhost) magento.example.com

{
    "socket": {
        "port": "8888",
        "host": "www.example.com"
    },
    "magento": {
        "path": "/var/www/magento",
        "host": "http://magento.example.com",
        "store": "0"
    },
    "api": {
        "host": "http://api.example.com",
        "provider": "magento"
    }
}
aonic commented 10 years ago

Also, since its a big change, I made the version 0.3.0 in package.json and bower.json. Let me know if you want me to change that to something else.

Should we stop making /dist/* files in git? And require the users to generate using grunt?

Wildhoney commented 10 years ago

Thanks, it works beautifully! Great work.