diff options
| author | Teddy Wing | 2013-04-27 20:19:29 -0400 |
|---|---|---|
| committer | Teddy Wing | 2013-04-27 20:19:29 -0400 |
| commit | 737b4aead58a3a9cd2bcba9cef91984f453d27c0 (patch) | |
| tree | 9ecbfcc97a50e6d7a8759299ae6eb35adbb1bfc3 /routes | |
| parent | 0d45e6fce95bccb90d86846fe33c60d7acb5cd1d (diff) | |
| download | Who-am-I-737b4aead58a3a9cd2bcba9cef91984f453d27c0.tar.bz2 | |
Render characters by calling API
To render the characters, get character names and image locations from
the internal API and render them using an Underscore template.
Diffstat (limited to 'routes')
| -rw-r--r-- | routes/character-images.js | 46 |
1 files changed, 24 insertions, 22 deletions
diff --git a/routes/character-images.js b/routes/character-images.js index 1927b04..dd63c83 100644 --- a/routes/character-images.js +++ b/routes/character-images.js @@ -1,28 +1,30 @@ module.exports = function(req, res) { var data = {}; - data.character_images = [ - { - image: '/images/characters-sample/homer.png', - name: 'Homer' - }, - { - image: '/images/characters-sample/marge.png', - name: 'Marge' - }, - { - image: '/images/characters-sample/lisa.png', - name: 'Lisa' - }, - { - image: '/images/characters-sample/bart.png', - name: 'Bart' - }, - { - image: '/images/characters-sample/maggie.png', - name: 'Maggie' - } - ]; + data.character_images = { + characters: [ + { + image: '/images/characters-sample/homer.png', + name: 'Homer' + }, + { + image: '/images/characters-sample/marge.png', + name: 'Marge' + }, + { + image: '/images/characters-sample/lisa.png', + name: 'Lisa' + }, + { + image: '/images/characters-sample/bart.png', + name: 'Bart' + }, + { + image: '/images/characters-sample/maggie.png', + name: 'Maggie' + } + ] + }; res.render('character-images', data); };
\ No newline at end of file |
