In ./models/todo
, the period indicates that node will look in the same folder that api.js
is in, which would look for \Todo List\routes\models\todo.js
. This does not start from the root of the application. To require this, you'll need to us two periods to jump up a level, and specify the app path as well:
var todo = require('../app/models/todo');