In this section, you're going to create your HTTP POST route for adding new Todos. Before we dive into that, we're first going to refactor everything we have in server.js. We have database configuration stuff which should live somewhere else and we have our models, which should also live in separate files. The only thing we want in server.js is our Express route handlers.
Resource Creation Endpoint - POST /todos
Refactoring the server.js file to create POST todos route
To get started, inside of the server folder, we're going to make a new folder called db, and inside of the db folder we'll make a file where all of this Mongoose configuration will happen. I'm going to call that file mongoose.js, and...