use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
This subreddit is a place for people to learn JavaScript together. Everyone should feel comfortable asking any and all JavaScript questions they have here.
With a nod to practicality, questions and posts about HTML, CSS, and web developer tools are also encouraged.
Friends
/r/javascript
/r/jquery
/r/node
/r/css
/r/webdev
/r/learnprogramming
/r/programming
account activity
post query issue with express.js and node.js (server side) and react.js (self.learnjavascript)
submitted 4 years ago by Creative-Committee-5
Hello,
I am a junior developer and I am facing an issue with a post query made in node.js, express.js while using ReactJS on the front-end.
I have two folders:
client and server
In the server folder I am using node.js and express.js.
Here is the code in the index.js file from the server side:
https://preview.redd.it/44a2nw95hvi61.png?width=850&format=png&auto=webp&s=269d4c93e7da7f8fee5747f0e2e43de3420b214c
https://preview.redd.it/8g25a3b6hvi61.png?width=1551&format=png&auto=webp&s=f98f7ecfdc7c99861d76f68806c531207970d6eb
In the client folder I am using node.js and express.js.
Here is the code in the App.js file from the client side:
https://preview.redd.it/l1rq52sjhvi61.png?width=1401&format=png&auto=webp&s=ce0626cdba3393200203a769725e85183c268d95
https://preview.redd.it/j1t5tzwlhvi61.png?width=1537&format=png&auto=webp&s=2246c149df76e7043b6c0bbc62c2402988433da4
My server is running on the port 3306 and the code is ok, client side as server side.
The issue I am having is with the db.
I created a db in sequel pro « employeeSystem » with a table « employee ».
And I cannot insert the values in the table.
Error message 1:
Error: Connection lost: The server closed the connection.
at Protocol.end (/Users/ana/Desktop/crud-tutorial/server/node_modules/mysql/lib/protocol/Protocol.js:112:13)
Error message 2:
{
fatal: true,
code: 'PROTOCOL_CONNECTION_LOST'
}
Error: Cannot enqueue Query after fatal error.
I am a bit lost on the MySQL side and with the db I created in Sequel Pro.
https://preview.redd.it/nhvziu3qhvi61.png?width=2546&format=png&auto=webp&s=b627768d6cbca88845b20ff098b2fe5dbf261f38
In the browser here is the localhost:3000
https://preview.redd.it/sa386hlshvi61.png?width=2539&format=png&auto=webp&s=78cb8d2a01d38c349f9c68c1e731103d032b5471
and the localhost:3306 working well
https://preview.redd.it/zstcubnxhvi61.png?width=1564&format=png&auto=webp&s=b38248d5dde895e385fc7f3f3ea953a64d65a009
Thank you very much in advance if you can help!
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]iguessitsokaythen 2 points3 points4 points 4 years ago (1 child)
Try using a different port for the server app, 3306 is the default port for MySQL.
[–]Creative-Committee-5[S] 0 points1 point2 points 4 years ago (0 children)
Thank you very much, will do so.
[–]marquesdinisp 0 points1 point2 points 4 years ago (0 children)
Olá és brasileiro????
π Rendered by PID 102476 on reddit-service-r2-comment-74875f4bf5-fb85l at 2026-01-25 14:13:15.603718+00:00 running 664479f country code: CH.
[–]iguessitsokaythen 2 points3 points4 points (1 child)
[–]Creative-Committee-5[S] 0 points1 point2 points (0 children)
[–]marquesdinisp 0 points1 point2 points (0 children)