Instantly share code, notes, and snippets.

Embed
What would you like to do?
Can I Get With That
var express = require('express');
var router = express.Router();
/* GET home page. */
router.get('/', function (req, res, next) {
res.render('index', {
title: 'Express'
});
});
// router.get('/forms-:paramUrl(\\d+)', (req, res) => {
// console.log(req.params.paramUrl); // retourne maValeur
// });
/* GET Username*/
// router.get('/forms-101', (req, res) => {
// console.log(req.query.level); // retourne maValeur
// });
router.post('/forms-:paramUrl(\\d+):level', (req, res) => {
console.log(req.body.username);
console.log(req.query.level);
console.log(req.params.paramUrl); // retourne Bob
});
module.exports = router;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment