Method URL Description Returns an array of words, with size GET /api/words/:query&count=:count count, all containing the string passed in the query URL parameter. Returns an array of all collections. GET POST /api/collections GET DELETE POST /api/collections DELETE /api/collections/:name /api/collections/:name /api/collections/:name/:word Creates a new collection. The name of the collection is part of the request body. Returns an array of all words in the collection with the provided name. 1 of 2 Deletes an empty collection with the provided name. Adds the provided word to the collection with the provided name. Deletes the provided word from the

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

words-app directory then create a Next.js 13.3 application inside words-app that implements the following API to manage multiple collections of words.
1. Data is provided to you in words.json. The file contains an array of almost every word in the (American) English language. Copy that file to words-app/data/words.json.
2. Add an endpoint to search for a certain number of words using a query text. The number of matching words is selected at random and returned. Return 10 words when the number of words is not provided. You should return at most 100 words per request.
3. Add an endpoint to read all collections. This endpoint is also used to create collections. Store your collections and their corresponding words under words-app/data/ collections.json. A collection is a set of unique words:
4. Add an endpoint to read all words in a collection, add a word to a collection, and delete a word from a collection.
5. You should validate all parameters provided by the user to the API and respond with an error (4xx) for invalid requests, such as an invalid parameter value, attempting to delete a non-empty collection, or attempting to delete a word from a collection that does not contain it.

i did 1,2 and 3,  I need step 4 and 5 please ?? 

Method URL
GET
GET
POST
GET
Description
Returns an array of words, with size
/api/words/:query&count=:count count, all containing the string passed
in the query URL parameter.
Returns an array of all collections.
POST
DELETE
/api/collections
/api/collections
DELETE /api/collections/:name
/api/collections/:name
/api/collections/:name/:word
/api/collections/:name/:word
Creates a new collection. The name of
the collection is part of the request
body.
Returns an array of all words in the
collection with the provided name.
1 of 2
Deletes an empty collection with the
provided name.
Adds the provided word to the
collection with the provided name.
Deletes the provided word from the
collection with the provided name.
Transcribed Image Text:Method URL GET GET POST GET Description Returns an array of words, with size /api/words/:query&count=:count count, all containing the string passed in the query URL parameter. Returns an array of all collections. POST DELETE /api/collections /api/collections DELETE /api/collections/:name /api/collections/:name /api/collections/:name/:word /api/collections/:name/:word Creates a new collection. The name of the collection is part of the request body. Returns an array of all words in the collection with the provided name. 1 of 2 Deletes an empty collection with the provided name. Adds the provided word to the collection with the provided name. Deletes the provided word from the collection with the provided name.
Expert Solution
steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Map
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education