Last active
January 4, 2020 20:15
-
-
Save prigara/c6832f94c842a3ca9bcb5d8658ac8329 to your computer and use it in GitHub Desktop.
In the sample app (https://github.com/JetBrains/webstorm-samples/tree/master/Express) replace routes/index.js with this file to follow the steps in the tutorial: http://blog.jetbrains.com/webstorm/2018/01/how-to-debug-with-webstorm/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require("express"); | |
var router = express.Router(); | |
/* GET home page. */ | |
router.get('/', function(req, res, next) { | |
res.render('index', { title: 'Welcome!' }); | |
next() | |
}); | |
router.get('/:lang', function (req, res) { | |
if (req.params.lang === "de") { | |
res.render('index', {title: 'Willkommen!'}); | |
} | |
else { | |
res.render('index', { title: 'Welcome!' }); | |
} | |
}); | |
module.exports = router; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment