Do you know we can send JSON object to the client side ?
And we mostly use JSON data to pass client side.
We’ll do it using res.end()
We need to create a server
first. You can see it from day 12.
Day 12 – Creating own server - Learning Node JS In 30 Days [Mini series]
Muhammad Ali (Nerdjfpb) ・ Dec 15 '19
Now we can create an JSON object
Now change the Content-Type
We can send the data to frontend now using res.end(JSONObject)
JSON.stringify()
A common use of JSON is to exchange data to/from a web server.
Can you send JSON data using node js now ?
You can see the graphical version here
Originally it published on nerdjfpbblog. You can connect with me in twitter or linkedin !
Top comments (0)