I'm putting together a React app that consumes data from a Node/Express REST API which is currently on my local machine. I've got a simple res.json
returning a Sequelize object, and I'm accessing it through a service I made. Obviously, I'm going to be putting the object in state
eventually, but I'm currently having difficulty accessing the values.
const options = {
method: "POST",
headers: {
"Content-Type": "application/x-www-form-urlencoded"
},
body: JSON.stringify({email: "matthewharp@gmail.com", password: "M1nerals"})
};
fetch('http://localhost:3000/users/sign_in', options)
.then(response => console.log(response.json()));
I'm getting the results in the console, but they're stuck in the [[PromiseValue]].
I must be missing some kind of async step, but I'm not sure what.