Working with a node server, I've set up a client-server model
, meaning the client connects to "localhost" and express generates a response
based on certain logic. While I'm able to send a JSON object through the response
, I'm unsure of how to access this JSON object in my client-side script. Can anyone guide me on this? Still learning here!
server:
app.get("/", function(request,response){
response.json({ username: 'example' })
})