RESTful api service that connects to MySQL database and creates/updates user's settings information.
File Location: /Users/jsc31994/Documents/projects/micro-services/settings-service/SettingsService
- Application Port = 3000
- Database Port = 3306(default)
- Host = localhost
- Username = root
- Password = password
- Database Name = userSettings
- Table Name = settings
- Node.js v12.10.0 (Nodemon recommended for hot reload)
- MySQL Server version: 8.0.20
DROP TABLE IF EXISTS `settings`;CREATE TABLE `settings` (`id` int NOT NULL AUTO_INCREMENT,`user_email` varchar(40) NOT NULL,`app_color` varchar(25) NOT NULL,`vibration_type` varchar(25) NOT NULL,`default_categories` varchar(100) NOT NULL,`alert_type` varchar(25) NOT NULL,PRIMARY KEY (`id`));
- Run
node app.jswithin terminal/cmd (nodemon HIGHLY recommended) - Open Postman and create new Request
- For Post Requests (creating a row)
- Select
POSTon request type - Enter
http://localhost:3000/api/userSettingson address line - Select
Bodytab under address bar - Write a JSON object or use...
{ "app_color": "blue", "vibration_type": "heavy", "default_categories": "[math, english, science]", "alert_type": "global", "user_email": "[email protected]" }- Hit
Send, if done properly, Success message will appear.
- Select
-
For Patch Requests (Updating a row)
- Select
PATCHon request type - Enter
http://localhost:3000/api/userSettingson address line - Select
Bodytab under address bar - Write a JSON object or use...
{ "app_color": "green", "vibration_type": "light", "default_categories": "[music, french, biology]", "alert_type": "in-app", "user_email": "[email protected]" }- Hit
Send, if done properly, Success message will appear.
- Select