NodeJS/Express – POST/GET form data to MySQL using Sequelize ORM – Ajax JQuery + Bootstrap view example
In the tutorial, we show how to save form data to MySQL in NodeJS/Express application using Sequelize ORM with Ajax JQuery & Bootstrap view.
Related posts:
- Sequelize ORM – Build CRUD RestAPIs with NodeJs/Express, Sequelize, MySQL
- Integrate NodeJS/Express – JQuery Ajax POST/GET – Bootstrap view
Overview
Goal
Technologies
- NodeJS/Express
- Sequelize ORM
- MySQL
- JQuery Ajax
- Bootstrap
We create a NodeJS/Express project as below structure:
/NodeJS-Express-Ajax-JQuery-Bootstrap-MySQL
/app
/config
db.config.js
env.js
/controllers
user.controller.js
/models
user.model.js
/routes
user.route.js
/node_modules
/resources
/static
/js
getrequest.js
postrequest.js
/views
404.html
index.html
package.json
server.js
Run above project then makes Post/Get requests, results:
-> Bootstrap view:
-> MySQL's table:
Demo
Practice
Setting up NodeJS/Express project
Create a folder: 'NodeJS-Express-Ajax-JQuery-Bootstrap-MySQL':
mkdir NodeJS-Express-Ajax-JQuery-Bootstrap-MySQL
cd NodeJS-Express-Ajax-JQuery-Bootstrap-MySQL
Then init NodeJS project, see prompts:
More at:
NodeJS/Express – POST/GET form data to MySQL using Sequelize ORM – Ajax JQuery + Bootstrap view example
Top comments (0)