Вот шо у меня есть:
app.get('/register/:realfirstname/:realsecondname/:username/:password', function (req, res) {
// Add validation
console.log(req.realfirstname)
console.log(req.realfirstname) - выводит undefined :(, вот как я посылаю запрос:
Вот весь код:
app.get('/register/:realfirstname/:realsecondname/:username/:password', function (req, res) {
// Add validation
console.log(req.realfirstname)
// Normal registration
MongoClient.connect(url, function(err, db) {
var dbo = db.db("test");
dbo.collection("userslist").insertOne({ realfirstname: req.realfirstname, realsecondname: req.realsecondname, username: req.username, password: req.password, sessionid: null, sessiontime: null }, () => {
db.close();
});
res.send("User registred");
});
})
app.listen(3000)
localhost:3000/register/Ashot/Tryboshat/marataziat...