I'm very newbie to nodejs.I'm practicing an Nodejs with express in MVC architecture with MySQL. All things are working fine, but I wonder why this application working POST request only once after server start.
This is my Controller
const IncData = require("../../models/Accounts_Models/Income_Model");
module.exports = {
create_income_head(req,res){
IncData.m_add_inc_head(req.con , req.body, function (err)
{
res.send(err);
}
)
}
};
My Model
module.exports={
m_add_inc_head: function (con,data,callback){
con.query('CALL Create_Income_Head (?,?,?,?,?,?)',[data.income_category,data.description,1,0,'',''],callback);
},
};
My Router
const express = require('express');
const router = express.Router();
const income = require("../../controllers/Accounts_Controllers/Income_Controller");
router.post("/add_income_head",income.create_income_head);
module.exports = router;
Someone please explain what went wrong in this code?