Local Development of Serverless Functions on Netlify
with Jason Lengstorf
Serverless functions are incredibly powerful, but how do you work on them locally? In this solo stream, Jason will show how Netlify Dev makes it painless!
Resources & Links
Captions provided by White Coat Captioning (https://whitecoatcaptioning.com/). Communication Access Realtime Translation (CART) is provided in order to facilitate communication accessibility and may not be a totally verbatim record of the proceedings.
Jason: Hello, everyone, and welcome to another episode of Learn With Jason. Today on the show, you're dealing with me, just me, no one else. We are going to work on some stuff. So, first and foremost -- oh, nice. Thank you for -- wait. Oh, no, the 404. Where did it go? Hmm, that's not good. We should fix that. So the Party Corgi is 404'ing. We'll figure out what's going on with that. Why don't we just flip right over to some desktops here and figure out what's going on with the Party Corgi Discord. Let's see. There it is. And where's the website? There's the website. Let's find -- oh, no. Did we accidently lose this in the -- here's the code of conduct. Okay. I don't know what happened. We need to get that back on the website. But for anybody who's looking for it, the code of conduct is here. Oh, it got moved. The URL -- okay. So we need to redirect. So the code of conduct is up and live, but we need a redirect for it. I bet we could build one of those. Let's go look real quick. I believe -- here's our redirect. That should actually be working, and it appears that it is not. So we should go figure out what happened. Okay. Well, that's a mystery that we should go and investigate. Also not what we were planning on doing today. What's up, everybody? How are you? Luke, your sub ran out. Well, I mean, you know, there are hackie ways you can boop. I probably shouldn't show you all this, but I'm going to do it anyway. There's a chat command that apparently doesn't work anymore. Fun. We're having a great day here. Looks like my overlay is being weird. I've had internet issues all day, and I'm wondering if there's something upstream or if it is something with -- man, just so many problems today with my API not working the way that I want it to. It should be showing this. Right. So there's that. For some reason, it's not updating in the -- man, just got issues. Just got issues today, everybody. So I don't know why it's showing the wrong thing here. I'll tell you what. How about this. How about we do this today. Before I forget, let's do a quick shout out. We have Rachel with us today from White Coat Captioning. White Coat Captioning is always with us doing live captioning for the episode. That's on the home page at learnwithjason.dev. Six months of Luke. I'll take many more than six months of Luke. And then the live captioning is made possible by our sponsors, Netlify, Fauna, Hasura, Auth0. All kicking in to make this show more accessible to more people. Make sure you check them out. These are all clickable on the homepage. Go and check those pages out. We're also, unfortunately, you hanging out with me today. That's what we are up to. Hey, what's up, Michael? Yeah, so Pachi was scheduled for today. She needed to reschedule last minute. So we are still going to do that episode, but we're not going to be able to do it today. So today I called an audible. I'm doing some solo stuff. Thank you for your understanding there. Yeah, I'm trying to figure out what's going on with my stream. So, now that we've done the things here where we've talked about the captioning, we've talked about the sponsors, let's go figure out why my serverless functions aren't doing what they're supposed to do. Look at this API, right. This API is showing me the right episode information. Local development of serverless functions on Netlify. Great. That's what we want. For some reason, this overlay down at the bottom here is picking up cached data. So I need to figure out why it's picking up cached data so that I can get it to stop it. So let's poke at the Learn With Jason repo. I have my scenes up here. This is what we're looking at now. It's a website, and the way that it gets data is through this hook that says use current episode. That use current episode is hitting a sanity API. Why doesn't it hit my API? Oh, boy. You know what? I thought I was going to have to come up with a project for today. Looks like we had one handed to us by me writing bad code. What a great time, everybody! Great news! We've got broken production issues that we can fix as part of the stream today. Yes! Excellent. So, let's -- yes, the compooper is misbehaving. Really, it's me. I did something wrong.
What are you doing, computer? Why? Why are you like this?
Jason: There it is. So, she made that and submitted it. Now there's a sound effect for that. So if anybody wants to pull request in sound effects, this is the format. You can do it. But that's not what we wanted to look at. I wanted to look at -- let's look at this /poster and figure out what's going on with it. I think -- how is it working? It should be here somewhere. I think it's episode.
Holy buckets, did that just work?
Jason: (Laughter) Yes. What listens for it? So what listens --
You hackers. You dirty hackers.