if you are starting new with Node JS, you will probably face this problem, while submitting the form to a post URL.
The problem you will face is getting a empty req.body in-spite of sending the form properly. To resolve this issue, you have make two change in your current system.
Add the following to the form element
enctype="application/x-www-form-urlencoded"
Though, if you do not add this it will still work as this is the default for a form.
The second thing, in your index.js in root add the following lines to unable the form.
app.use(express.urlencoded({
extended: true
}));
This is it, now you will be able to receive the form data in req.body
if you are facing the same issue for the JSON inputs in your API calls, please check the link here to unable it.
#code-quality #vscode #laravel-pint #laravel
I have been using the unsatisfactory formatters from a long time. All of them have one thing but lack other. Laravel Pint is one who has it all, combining it with vscode is like proving you laravel project a super power.
AppImages are the most easiest to run compared.The challenging task is to make the AppImage accessible globally through he system like an installed application (in the menu)
#express js #node #node js #sequelize #mysql
In the very initial days of my work in Node JS if faced this issue. Though Sequelize provide a great ORM for MySQL but the association within the models is a bit tricky.
#database #javascript #sequelize #npx
list of Sequelize CLI commands which comes handy, while working on a project.
#functionality #pwa #javascript #laravel
The progressive web app is the new trend as well as the need for the present time. I hope before getting in the “HOW” part you know what is exactly a PWA
#express js #node #node js #sequelize #mysql
In the very initial days of my work in Node JS if faced this issue. Though Sequelize provide a great ORM for MySQL but the association within the models is a bit tricky.
#express js #npm #deployment #api #node #node js #javascript #npx #boilerplate
Initiating a new project is as exciting as frustrating. Going through all the routine work just to get the basic engine started, yaa I know the pain.
#express js #file-upload #node js #multer
File upload in node js is one hell of a job. Not knowing how is makes it a bit more troublesome
#express js #api #node #node js #web services
Thought it sounds simple and straight forward, this thing killed a lot of my time at the initial time of getting into node JS.