Challenge Overview

The Branded-Destination challenges are a set of challenges where we will be building out an Express application that host pages that are viewed on a STB (Set Top Box).

For this challenge we will be making a call to an API for account information when user requests the base path of "/" for this site. We'll be hard coding the account Id into the app for the short term while we resolve some issues on retrieving the account Id. In doing this, we're going to short circuit the call that's made here and use our Code Big base libraries to search the Einstein service for the hard coded Id. The hard coded Id should be the one specified in the unit test configuration for the Base Libraries.

The resulting payload from the Einstein Service will look like this. We need to grab the first phone number of the "phones" array and the full array of "emails" from the top level of the JSON payload and insert them into the user session. You will need to add session support to express in doing so. Finally, after setting the information in session, render the index template to the user. Adjust the template to show the session information that you added for phone and email.

Requirements:

  • Short circuit (but leave in place or comment out) existing XSCD endpoint calling code and call to the Einstein svc using the Code Big base libraries utilizing the test account Id found here for requests to "/".
    Add session support to Express and set the first phone number and full array of emails returned to einstein into the user session.
    render the index template on completion of calls to Einstein. Setting the added variables from the session into the template.
    Write unit tests for all routes.
    The app should be deployable to Heroku. This will require an .npmrc and NPM_TOKEN env var. See this page.

Setup & Reference:

  • Fork this repo and work off this branch. Request repo access in the forums.
    Note that the ultimate intended audience will be viewing the page on a STB (Set Top Box) and will need to be able to navigate using only the keyboard. The prototype is built with this in mind so use the keyboard to see all views. This applies to the front end designs and not to the data fetching portion of this challenge series
    Use Node version 4.4.X
    Use the latest stable version of Express.
    Feel free to include any addition OSS modules that improve the maintainability of the code base.

  •  


Final Submission Guidelines

  • Ensure good test coverage on all modules
    Upload documentation for how to run your submission
    A video of your working solution is required
    Upload all your source code as a zip for review
    Winner will be required to submit a pull request with the winning code.

Review style

Final Review

Community Review Board

Approval

User Sign-Off

ID: 30054879