Skip to content

Instantly share code, notes, and snippets.

@prigara
Last active Jan 4, 2020
Embed
What would you like to do?
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/
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