diff options
Diffstat (limited to 'routes')
| -rw-r--r-- | routes/character-images.js | 28 | ||||
| -rw-r--r-- | routes/home.js | 8 | ||||
| -rw-r--r-- | routes/index.js | 13 | ||||
| -rw-r--r-- | routes/user.js | 8 |
4 files changed, 42 insertions, 15 deletions
diff --git a/routes/character-images.js b/routes/character-images.js new file mode 100644 index 0000000..1927b04 --- /dev/null +++ b/routes/character-images.js @@ -0,0 +1,28 @@ +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' + } + ]; + + res.render('character-images', data); +};
\ No newline at end of file diff --git a/routes/home.js b/routes/home.js new file mode 100644 index 0000000..2c1be44 --- /dev/null +++ b/routes/home.js @@ -0,0 +1,8 @@ + +/* + * GET home page. + */ + +module.exports = function(req, res){ + res.render('index'); +};
\ No newline at end of file diff --git a/routes/index.js b/routes/index.js index f296005..7d9dd59 100644 --- a/routes/index.js +++ b/routes/index.js @@ -1,8 +1,7 @@ - -/* - * GET home page. - */ - -exports.index = function(req, res){ - res.render('index', { title: 'Express' }); +module.exports = function(app) { + var index = require('./home') + , character_images = require('./character-images'); + + app.get('/', index); + app.get('/character-images', character_images); };
\ No newline at end of file diff --git a/routes/user.js b/routes/user.js deleted file mode 100644 index d5b34aa..0000000 --- a/routes/user.js +++ /dev/null @@ -1,8 +0,0 @@ - -/* - * GET users listing. - */ - -exports.list = function(req, res){ - res.send("respond with a resource"); -};
\ No newline at end of file |
