In this tutorial, we will build a famous todo app with Node.Js using ExpressJs framework and MongoDB.

The explosion of IoT has made developers start thinking API first, and before you wonder why I didn’t title this post Build a Todo App API with Node.Js ExpressJs, MongoDB, and VueJs; I gotta tell ya, we’ll build the client in part two of this post using Vue.Js.

js and update it with the following content: – – First, you would want users to get a list of all to-do items existing in the database, hence we defined a route (/all) that accepts a get request and returns a JSON object of todo items if successful.

When Mr. A makes a post request to route (/add), a new to-do item is created in the database.

At the project root folder, create a server.js file and update it with this: – – // Use morgan to log request in dev mode // Use routes defined in Route.js and prefix it with api // Website you wish to allow to connect // Request methods you wish to…

Especially because most tutorials or guides will tell you to simply dump all your Component.Vue files in one folder, src\components.Sure, components are to be kept small; but by placing your components HTML-template, scoped CSS styling and JavaScript in the same file, the size quickly gets out of hand.

Now imagine the merge-conflicts because you edited a components template and someone else updated its styling.Fortunately, the team behind Vue.JS is aware that devs might be bothered by this, so they offer an alternative in their guide: we can reference script and style files in our Vue files.Take, for example,…

Such a view is always a component, but a component isnt necessarily a view.To easily navigate through larger-scale projects, I tend to make a separate views folder in src to contain these view-components.

I still had to find a suffix for the JavaScript files of actual, reusable components.