Resource Creation Endpoint - POST /todos

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.

Get Advanced Node.js Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.