Set Up - mirkode/asana-code-challenge GitHub Wiki

  1. Clone the directory.
    git clone https://github.com/mirkode/asana-code-challenge.git

  2. cd into repository.
    cd asana-code-challenge

  3. Copy .env.example to .env.
    cp .env.example .env

  4. Modify .env file.
    vim .env

  5. Insert all needed API endpoints, keys, and data (more on this below).
    DEFAULT = Insert your desired default provider (for me that is Google).
    e.g. GOOGLE_API_KEY = Your Google Maps API key

  6. Start Up.
    Fire up the app in the asana-code-challenge directory by entering rackup -p 4567 (or any other port you need)

  7. Add Google Maps API key to index.html.
    Scroll to the bottom to the index.html page or search for <!-- ADD GOOGLE MAPS API KEY HERe -->.
    Replace YOUR API KEY HERE with your Google Maps API key, uncomment the script block and save the file.
    In case you have forgotten this, there will be a little alert popping up.
    As this is an acceptable solution if this app would be on production, please also delete the following lines:

    153   // Just a quickfix for development only.
    154   // TODO: remove
    155   setTimeout(function () {
    156     if (typeof(map) === 'undefined') {
    157       alert('Cannot load the map.\nDid you forget to set the API key in the index.html?\nPlease add it, otherwise the app won\'t function properly.');
    158     }
    159   }, 500);
    
  8. Access.
    In a browser open up http://localhost:4567/