Angular Dynamic Data with Sanity.io with Tara Z. Manicsic

Netlify Functions Live Logs

Now that we have the Netlify Function working locally, let's check it out in the real world!

📓 Resources 📓

TRANSCRIPT

We've seen these locally. Let's see what it looks like live where we find our function information live in the logs. To do that, we're going to run git status to see what have we changed. We changed all these things, let's add all of them. With my alias G-A, let's do git add period, git add everything, git commit, with the message "adds getProducts function." Oh, yes, we also added the dev environments for our [00:00:30] configuration file.

We'll push that up, and again, that push will trigger a build and deploy of our project Netlify. I do whatever git tells me to do, so we're going to run git prune. Once that's all set, we'll clear that and we'll push that up to our repository, and we can run Netlify open or MTL open to go to our project dashboard in Netlify. There we can see [00:01:00] that we are building, and we're building that last commit to our main branch.

Once that is done building, we will again go to the angular-sanity.netlify.app to see our project live. Basically, we're doing the same thing we did locally where we went to the route of our function. You will always find your functions at /.netlify/functions, [00:01:30] and then you just put the name of the function, which for us was getProducts. We'll put that into the URL, and when we hit enter, we should see again, that lovely block of data, but we can go to our functions tab, go to getProducts, and see there's each of our products, the JSON.stringify version of them. Success.

[00:01:59][END OF AUDIO]

Explorers

your progress

69