4Geeks logo
About us

Learning library

For all the self-taught geeks out there, here is our content library with most of the learning materials we have produced throughout the years.

It makes sense to start learning by reading and watching videos about fundamentals and how things work.

Data Science and Machine Learning - 16 wks

Full-Stack Software Developer - 16w

Search from all Lessons

Social & live learning

The most efficient way to learn: Join a cohort with classmates just like you, live streams, impromptu coding sessions, live tutorials with real experts, and stay motivated.

← Back to Projects

Create an API Rest in NodeJs with ExpressJS

Goal

4Geeks Coding Projects tutorials and exercises for people learning to code or improving their coding skills

Difficulty

beginner

Repository

Click to open

Video

Not available

Live demo

Not available

Average duration

2 hrs

Technologies

🔥 This exercise is designed to be performed by 1 person.

Technologies: Node, express, express-generator.

We are going to create a REST API that in it we can manage an array of tasks from node/express.

The idea is to create with node and express the different endpoints or routes to perform a CRUD (Create, List, Update, Delete) on an array of tasks.

🌱 How to start this project

a) Configure express from scratch.

b) Create the project using express-generator.

💡 Important: save your code to your new repository using add, commit and push.

Strategy

Take a few minutes to analyze 🤯 your strategy on it, identify the elements that you are going to use as express:

Once the strategy is finished you can start coding, start programming 🎊!

About the project we are going to build

In this project we must build a REST API that exposes the following 4 routes to the internet:

1GET /todos 2POST /todos 3PUT /todos/:position 4DELETE /todos/:position

GET /todos

It should return the existing tasks in the array.

1[ 2 { 3 "done": false, 4 "label": "Sample Todo 1" 5 }, 6 { 7 "done": false, 8 "label": "Sample Todo 2" 9 } 10]

POST /todos

We must be able to send the following data to the endpoint and be able to add said data to the tasks array.

1{ 2 "done": false, 3 "label": "Sample Todo 1" 4}

PUT /todos/:position

We must be able to send the following data to the endpoint and be able to update said data in the task array according to its position.

1{ 2 "done": true, 3 "label": "Sample Todo 1" 4}

And return the updated list of all.

DELETE /todos/:position

You should remove the task from our array according to the position given to the endpoint in the url and return the updated list of tasks.

Goal

4Geeks Coding Projects tutorials and exercises for people learning to code or improving their coding skills

Difficulty

beginner

Repository

Click to open

Video

Not available

Live demo

Not available

Average duration

2 hrs