Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Integrating a Postgres Database with Express API project: Create two database tables, Express API project will need to be modified to connect to the Postgres

Integrating a Postgres Database with Express API project:
Create two database tables,
Express API project will need to be modified to connect to the Postgres Database using pg
React app logLog In Endpoint will accept credentials from React app, read the credentials from the database, and compare.
Return 200 and return the primary key of the user account if comparison check passes.
Return 400 if no user account exists.
Return 401 if comparison check fails.
Registration Endpoint will accept data from React app, insert new record into the user_accounts table
Return 201 and return the primary key of the newly created user account.
Return 409 if that username already has a user account.
Account Endpoint POST will accept data from React app, including the primary key of the user making this update, insert new record into the user_account_details table
Return 200 and return the newly created data entry.
Account Endpoint GET will accept user primary key, read user_account_details from the database
Return 200 and return all the data from the user_account_details record for that user
Return 204 if there is no data in the user_account_details for that user
Account Endpoint PUT will accept user primary key, read user_account_details from the database, update existing record of the user_account_details table
Return 200 and return all the data from the user_account_details record for that user
Return 404 if no existing record is found for that user primary keyic will need to be updated to know which endpoint to hit as well as handle any errors from Express
Must be mobile responseness

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Datacasting How To Stream Databases Over The Internet

Authors: Jessica Keyes

1st Edition

007034678X, 978-0070346789

More Books

Students also viewed these Databases questions