Web DevelopmentBeginner 2 to 3 hours

Build a Basic Express/Next.js API

Create the backend routes to Create, Read, Update, and Delete data.

The Scenario

A local library wants to digitize their book inventory. They need a simple backend API to manage the catalog. For now, they just want to store the data in memory (an array) while they figure out their database strategy.

The Brief

Build a basic REST API using Express.js or Next.js API Routes. Implement four endpoints for a "Book" resource: GET (list all books), POST (add a new book), PUT (update an existing book by ID), and DELETE (remove a book by ID). Keep the data in a simple JavaScript array.

Deliverables

  • The API route files handling the GET, POST, PUT, and DELETE requests
  • The basic validation logic (e.g., ensuring a POST request has a "title" and "author")
  • A README snippet explaining how to test the endpoints using a tool like Postman or curl

Submission Guidance

Focus on returning the correct HTTP status codes (e.g., 201 Created, 400 Bad Request, 404 Not Found, 500 Internal Server Error).

Submit Your Work

Your submission is graded against the rubric on the right. If you pass, you get a public Badge URL you can share on LinkedIn. There is no draft save, so work offline first and paste your finished response here.

This appears on your public Badge.

0/20000 charactersMarkdown supported

One per line or comma separated. Up to 5 links.

By submitting, you agree your submission text, name, and evaluation will appear on a public Badge URL.