Skip to content

Instantly share code, notes, and snippets.

Last active Jan 4, 2020
What would you like to do?
In the sample app ( replace routes/index.js with this file to follow the steps in the tutorial:
var express = require("express");
var router = express.Router();
/* GET home page. */
router.get('/', function(req, res, next) {
res.render('index', { title: 'Welcome!' });
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