DEV Community

Discussion on: Build a Todo App with Node.Js, ExpressJs, MongoDB and VueJs – Part 2

Collapse
 
thuycis2018 profile image
thuycis2018 • Edited

Thanks Mark J. I got error when running 'npm run build'. So I followed your suggestions, checked for file structure and used your webpack.config.js.

I got passed this error. However, when I load the app, add/delete/all work but update function didn't work (.save callback function didn't fire).

So I made this change and it's now working:

todo.save({
function (error, todo) {
...
}
})

Changed to (removed {})

todo.save(
function (error, todo) {
...
}
)

Based on suggestions on best practice, I also changed file names to lowercase (todo.js, routes.js, config.js) and variable Todo -> todo.