Node JS Tutorial for Beginners #34 - Making a To-do App (part 4)

Net Ninja · 121K views · 2016 · 16:17

Open on YouTube

Web developmentPython, Ruby & scripting languagestutorialdated

Why Stack Overflow recommends it

Stack Overflow users cite it because they are following this tutorial step by step and hit problems with POST handling, route code and undefined items, so the video is the shared reference for their code.

Recommended by 1 people across 1 different months, 2018 to 2019.

What it is

Part 4 of The Net Ninja's Node.js beginner series, where Shaun builds a to-do app with Express, EJS and body-parser. This installment wires up the POST and DELETE routes and uses jQuery Ajax on the client to send data to the server.

What people said

Recommends Advena · 2018-06 · Stack Overflow · on “POST data to NodeJS using fetch()”

I've been trying to learn NodeJS following this NodeJs Youtube Tutorial [LINK] . I already worked with the Fetch API [LINK] for a couple of months to get data from WordPress and Google Sheets back ends. The last videos of the Youtube playlists are about creating a To Do List app with NodeJS and the npm's express, EJS and body-parser. However, at part 4 of the To do list app [this video] , this "teacher" is using jQuery with Ajax to POST data to NodeJS ( His jQuery Code Snippet [LINK] ). Since I've only been working with fetch() for AJAX POST requests, i wanted to continue with this method in plain JavaScript. My ejs file, called todo.ejs, storing the HTML Template of the page looks like this: <!D

Cites cozimo · 2018-05 · Stack Overflow · on “Node.js cannot read property 'item' of undefined”

I was doing The Net Ninja's Making a To-do App tutorial ( [this video] ). I am able to delete pre-defined items on the To-do-App but I am unable add items. Everytime I try to add an item, I get the error below. It seems there's something to do with the todos[i].item being undefined. Thanks for your time! Below is the .ejs file that contains the To-do-App. TypeError: C:\Users\dlma1\Desktop\Nodejs Practice\znode-js-playlist\views\todo.ejs:17 15| <ul> 16| <% for(let i=0;i<todos.length;i++){ %> >> 17| <li><%= todos[i].item %></li> 18| <% } %> 19| </ul> 20| </div> Cannot read property 'item' of undefined **Edit: So there were quite a few files and I didn't want to overwhelm people so I'm going to post

Cites Mike Kim · 2019-06 · Stack Overflow · on “The exact same code from a tutorial that keeps giving me syntax errors”

So... this is the exact same code from a youtube tutorial and when he typed this code and ran it, he didn't get a single error but when I did it, I got 2 errors which are ';' expected and ',' expected. The link to the original code on the tutorial: [this video] module.exports = funciton(app) { app.get('/todo', function(req, res) { res.render('todo'); }); app.post('/todo', funciton(req, res) { }); app.delete('/todo:item', function(req, res) { }); }