Answer the question
In order to leave comments, you need to log in
How to use in express req, I have a problem with routes?
Here is what I have:
app.get('/register/:realfirstname/:realsecondname/:username/:password', function (req, res) {
// Add validation
console.log(req.realfirstname)
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)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question