hmanne23 / P6

0 stars 0 forks source link

Problem 1 User Story (Development) #1

Open jai1007-lab opened 1 year ago

jai1007-lab commented 1 year ago

As a student tasked with Problem 1 of Project 6, my goal is to transition the Photo Sharing Application's web server to use the MongoDB database. This transition will involve the development of specific API routes to retrieve data from the database. Transition to MongoDB: • Refactor the web server's routes to interact with the MongoDB database to fetch data. • The previous reliance on var models = require('./modelData/photoApp.js').models; in webServer.js will be eliminated. • All routes will return JSON-encoded model data in response to HTTP GET requests, adhering to a specific API specification outlined below. Acceptance Criteria: • All routes in the web server should be modified to fetch data from the MongoDB database instead of using the previous magic models. • The /test route should correctly return schema info and object counts from the database. • The /user/list route should return user properties needed for the navigation sidebar, replacing the previous models.userListModel() call. • The /user/:id route should return detailed user information when a valid user ID is provided. It should also handle invalid inputs gracefully. • The /photosOfUser/:id route should return user photos, associated comments, and necessary properties. It should handle invalid user ID inputs gracefully.