To build a REST API using NodeJS to handle customer data and store it in an SQL database
To create a POST API that accepts JSON input for first name, last name, email, mobile number (with country code), address, and pin code. Implement validation for email, mobile number, and pin code. Upon receiving a valid request, store the data in a SQL database using a stored procedure, with a table named "Customer Details". The table will include f ields for a unique Customer ID (auto-generated), first name, last name, email, mobile number, address, and pin code. The API will return a success response on successful insertion or a failure response if validation fails or the insertion is unsuccessful.
I used Express.js in the frontend. And have used MySQL for database configuration and to hit the API used Postman platform.
* POST API that allows customers to register their personal information.
* API will validate the input data and securely store the customer details in a SQL database.
* Created API Response Handling.
Refer to https://nodejs.org/en/ to install nodejs
Refer to https://nodejs.org/en/ to install postman
Refer to https://www.mysql.com/downloads/ to install mysql
Clone the project in localhost
git clone https://github.com/Dushyant029/RESTAPI-NodeJS-MySQLDB.git
Install all the npm packages. Go into the project folder and type the following command to install all npm packages
npm install
In order to run the application Type the following command
npm start
''' The Application Runs on localhost:3000
* NPM
* EXPRESSJS
* POSTMAN
* MYSQL