You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
Now that we have the document schema and type, we need to create API endpoints to interact with documents in the MongoDB database. This task includes fetching a document by ID, retrieving all documents, and uploading a new document.
Acceptance Criteria
GET api/document/[id] - Get a document by ID.
GET api/document - Get all documents.
POST api/document - Upload a document (each request body field should match schema fields).
Steps:
Define routes
Add route logic
Add error handling
Test using an API platform like Postman (or the thunder client vscode extension)
Description
Now that we have the document schema and type, we need to create API endpoints to interact with documents in the MongoDB database. This task includes fetching a document by ID, retrieving all documents, and uploading a new document.
Acceptance Criteria
api/document/[id]
- Get a document by ID.api/document
- Get all documents.api/document
- Upload a document (each request body field should match schema fields).Steps:
Additional Information
The text was updated successfully, but these errors were encountered: