Up and Running with Serverless Functions with Ben Hong
Deploying Serverless Functions
Now that we have our Pokedex API set up, let's go ahead and learn how to deploy our serverless functions. I'll start by staging. Everything would get add, and then we'll add a good commit message feature at Pokedex API. And once that's done, all we need to do is run. Get push origin main, which will push it up into our get hub repository and trigger a build inside of Netlify.
If you go ahead and open up to netlify.com and go ahead and log in. We'll go ahead and open up our site, which in my case is my first serverless site. Yeah. If we go into the deploy tab, we can go in and check on the deploy logs. So we checked on the most recent one. We can see everything that's happened inside of this log.
So go ahead and open up our site. And when I opened up the dev tools with the network tab, you'll see, then want to click on fetch. If that's just our hello world API, as you can see here, we have our object with message inside with hello world. And when we click on the fetch polka next button. Everything works exactly as we expect still.
And if you're wondering how we access the function logs, it's here under the link functions, which should go ahead and open this up into the functions tab. And here you'll see our different serverless functions. And when we click into them, you'll get to see the time that they're invoked as well as any logs that you might have inside of the function when it's run and believe it or not, that's all it takes to deploy serverless functions with Netlify.