Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- app.get("/adddates", function (req, res) {
- var url_parts = url.parse(req.url, true);
- var query = url_parts.query;
- console.log("does this get called?"); //Response 1 here is correct
- console.log(query); //Response here 2*
- console.log(query['name']); // Response 3 here is undefined?
- if(query["Name"]!==undefined) {
- var tx = { Name : query["Name"],
- Description: query["Description"],
- Date: query["Date"],
- People: query["people"],
- Tag: query["Tag"]
- };
- console.log(tx);
- todos.push(tx);
- console.log("Added " + tx.message);
- res.end("Todo added successfully");
- }
- else {
- res.end("Error: missing message parameter");
- }
- });
- 2* = { '[{"Name":"testetst","Description":"Blasts","Date":"2016-12-08","People":["Sjaak"],"Tag":"': '' }
- [{"Name":"testetst","Description":"Blasts","Date":"2016-12-‌​08","People":["Sjaak‌​"],"Tag":""}]
- query[0]["Name"]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement