Skip to content

Commit

Permalink
Create a cookie from the language controller, based on a request para…
Browse files Browse the repository at this point in the history
…meter
  • Loading branch information
lmarkus committed Dec 4, 2013
1 parent fcc4c66 commit b26bcce
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions controllers/setLanguage.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@

module.exports = function (server) {

server.get('/setlanguage', function (req, res) {
var model = { name: 'kraken-example-shopping-cart' };
server.get('/setlanguage/:lang', function (req, res) {

res.render('setlanguage', model);
res.cookie('language', req.param('lang'));
res.redirect('/');

});

Expand Down

0 comments on commit b26bcce

Please sign in to comment.