Create a Model to Manage Data for an Express API

Jamund Ferguson
InstructorJamund Ferguson

Share this video with your friends

Send Tweet

We'll create a new Map() data structure to store Notes that are passed into our API in memory. With that in place we'll create a model called Note.js that has the responsibility for saving and manipulating those notes and saving them back into our data store. After we hook up the our routes to call into our Note model and confirm that it all works.

To power our API we use some modern JavaScript syntax:

Mortimer Jarasemy
Mortimer Jarasemy
~ 10 months ago

The code doesn't seems to be the same on the lesson, things like mapStore were not in the lesson, for some reason, my queries, don't seem to be accessing the model, they keep sending the same answer as in the earlier lesson.

Jamund Ferguson
Jamund Fergusoninstructor
~ 10 months ago

Mortimer, I think you're right, let me make sure the code matches. Will try to get this done later today.

Mortimer Jarasemy
Mortimer Jarasemy
~ 10 months ago

Also how does the code know that it must execute this exported functions, I don't see any nexus in the lesson, and my functions are not being launched when I send the queries