Building the Final Application - welikepie/asos-hangout-app GitHub Wiki

Before running the grunt commands necessary to build the final part of the project, it is important to first edit the package.json file. This is accomplished by filling out the details in the package.js file with regards to the previously compiled and released hangout apps.

An example package.json file:

"app": {
    "title": “{title of app}",
    "baseUrl": "{url of root folder, with / on end}",
    "baseSslUrl": "{url of root folder with ssl, with / on end}",
    "hangoutAppId": "{ID of hangout app to be used on the front end (ASOS Shop-Along App)}",
    "hangoutUrl": "{https:// URL to front end hangout app}",
    "stagingAppId": "{ID of hangout app used for staging for public (ASOS Shop-Along Staging)}",
    "stagingHangoutUrl": "{https:// URL to hangout app on server used for staging for public with / on end}",
    "stagingAdminAppId": "{ID of hangout app used for the admin side of staging(ASOS Shop-Along Staging [Admin])}",
    "stagingHangoutAdminUrl": "{https:// URL to hangout app used for admin side with / on end}",
    "hangoutAdminAppId": "{admin app ID (ASOS Shop-Along App Admin)}",
    "hangoutAdminUrl": "{https:// URL to admin app on server with /}",
    "nodeUrl": "{url of root folder}:8889/"
  },

Now that the hangout apps are published, you can run the following grunt commands;

grunt node-backend-release
grunt landing-page-release
grunt admin-dev

You can now upload the node-backend-release folder, landing-page-release, admin-dev to your server.

Server side security and .htaccess

Make sure that the .htaccess files in the build folder point to the .htpasswd file by using the absolute path of the htpasswd file you wish to use on the server where necessary. In other cases, it will be necessary to change the .htaccess RewriteBase property to accurately reflect folders. To do this, use a similar syntax to what is already present, modifying the folder paths to meet your needs to the folder. E.g; RewriteBase might be /asos-hangout-dev/admin/gateway . This would need to be changed to the path to the gateway folder, were you accessing it directly through URL, without domain name.

Change the password contained in the .htpasswd file. The way to do this is to SHA1 hash your password and paste it into the document. Create new users with a new line in the file, followed by user, a colon(:), and then {SHA} and then the password, SHA1 encoded. A tool to create these new users and passwords can be found here. Be sure to select “SHA 1” when using the tool. If there is no {SHA} in the output, the password won’t work. Be careful to have the file endings as Unix type, as any other file type tends to cause errors with authentication.

A possible example of a .htpasswd file:

admin:{SHA}UPNF3F3h8aww3PGG4X8fl9kfOzQ=
doctor:{SHA}Vy6Kl0QQ8shHILaYo6aGvXtJug8=
amy:{SHA}3coKjYhohlGLl9/cF2en8vHcDGU=

Step Nine: Starting the Application