Learning to Store and Retrieve Data: Data Storage

Think of our server as a library that houses key app data. In this lesson, we will learn how to store this data in our server. We'll use JavaScript to create JSON objects, which will store our data in an easily accessible manner. Imagine that we're building a blog app, and we are storing a list of blog posts.

Here, our data object stores an array of blog post objects. Each post has an id, title, and content.

Learning to Store and Retrieve Data: Data Retrieval

Just as a library retrieves books for you, our server fetches data when needed. We use routes in Express.js to handle these requests.

This line instructs the server to respond to a GET request at /api/posts with the data in our object.

Sign up
Join the 1M+ learners on CodeSignal
Be a part of our community of 1M+ users who develop and demonstrate their skills on CodeSignal