Build Your Own HTTP Server from Scratch | CodeCrafters Challenge
ฝัง
- เผยแพร่เมื่อ 21 ก.ค. 2024
- One of the best ways to learn a technology is to build it from the ground up. That’s the premise of CodeCrafters, which offers a catalog of challenges to build popular tools and technologies from scratch (think things like Docker, Git, Redis, a DNS server, etc.).
🌟***CodeCrafters Affiliate Link***🌟
Sign up here: app.codecrafters.io/join?via=...
In this video, I’ll walk you through the “Build your own HTTP server” challenge. Using the platform, you’ll build a HTTP server that's capable of handling simple GET/POST requests, serving files and handling multiple concurrent connections. Along the way, we'll learn about TCP connections, HTTP headers, HTTP verbs, handling multiple connections and more.
The idea of CodeCrafters is to “learn by doing,” and there are lots of ways to write the code. I’ll show you code examples and hints that you can use to get you started writing your own code. There’s no completed code for download (as that would kind of defeat the point 😊).
🌟***TIMESTAMPS***🌟
00:00 - Building an HTTP server from scratch
00:42 - What is CodeCrafters and what kinds of challenges can I work on?
02:04 - Starting the challenge to build your own HTTP server from scratch, with Python
03:33 - Setting up the GitHub repository for a CodeCrafters challenge
03:58 - The leaderboard in CodeCrafters
04:16 - Cloning and pushing to the CodeCrafters repository
05:39 - Creating the HTTP server and binding to a port
08:13 - Responding to an HTTP request with a 200 OK response
11:20 - Responding to an HTTP request with a 404 Not Found response
14:23 - Responding to an HTTP request with content
16:18 - Parsing HTTP headers
17:20 - Handling multiple concurrent requests to the HTTP server
19:13 - GET a file through HTTP and display the contents
21:13 - POST a file through HTTP
22:49 - Completing the challenge and what comes next - วิทยาศาสตร์และเทคโนโลยี
If you've ever wanted to better understand how an HTTP server works, then this one is for you. Hope you enjoy! 🤓
Your tutorials have always been very informative and practical, keep up the good work!
I'm so glad!! Thanks for the nice comment, @x13set! 🙏🥰🌟
Just found your channel, and you doing absolutely amazing job by building a project from scratch and most importantly explaining the pricing upfront so that we know how much it will cost. I was trying to find a channel like yours who can help build project portfolios, please keep up the good work, I’m sure people will follow you over the time.
Hey @BrownBoy_07! 👋 Wow, thanks for such a nice comment! I'm so glad you're enjoying the projects. I hope to make many more. Cheers! 🤓🙏
Thanks for turning us on to the CodeCrafters Challenge. I'm going to give it a try right away!
I agree that building things yourself is the best way to learn. Learning from first principles is a powerful way to gain a deep understanding of ... anything.
Nice work on this episode, as always.
You are so welcome! Thanks for the nice comment, and hope you were able to complete the challenge! 🤓💪
A great teacher can make all the difference. I hope you know that you are amazing.
Awwww, shucks!!! Thanks so much for the nice comment! 🥰🙏🥰
Thank You So Much!!
You bet! Thanks for watching! 🙏🤓🌟
At 6:35 how did you get those files? I am very new to programming and very confused.
Hi @individualmayhem! 👋 All good...you have to start somewhere! 😊 Those code files were cloned from the CodeCrafters GitHub repository. This all happens in the "Repository Setup" step around 03:37. You'll need to install Git, have a GitHub account and then a way to interact with it (like VS Code, GitHub Desktop or even just a command line). I cloned the code files to my machine then was working with them in VS Code.
I don't have any Git/GitHub videos on my channel, but if you need the basics of that, @deborah_kurata has some great content on her channel: th-cam.com/video/pICJdbC7j0Q/w-d-xo.html
Hope that helps! 😊
Is it possible that C Code in *Bind a Port* section is much more complex? I cant include the Library in Windows..is it working only on linux?
Hey @saliva776! 👋 Sorry for such a slow response! Were you able to sort this out? Yes, it's possible that the "Bind a Port" section was more complex when using C. I came across a few issues when using Windows (a lot of the lessons/comments seem to be related to Mac/Linux), but with a little bit of Googling, was able to find the equivalent. If you found a solution, feel free to post it here in case it helps others. 🤓
Where is Block Coding view of web site?
Hey @LegoRoboticsCreator! 👋 Are you talking about a drag-and-drop coding experience?
Thank a lot 🎉🎉🎉🎉🎉🎉
For sure! Hope you like it! 🌟🤓
At 15:16 where is the code that you pasted? Thank you
Hey Adam! 👋 My code isn't the only correct way to do things (which is why I didn't upload everything), but here's what I came up with for that stage: drive.google.com/file/d/1m0xF88-C6g3Izrg3US9YNHq2ZxUOepU2/view?usp=sharing. Have fun! 🤓
@@TinyTechnicalTutorials Thank you
Thanks
You bet! Thanks for watching! 🙏🌟🤓
Very nice videos mam...mam pls make some video related ECS Eks also
Thanks so much!! 🙏🌟🤓 I do have an ECS video here: th-cam.com/video/86Ys0LnMSnY/w-d-xo.html. I'll add EKS to my list of future videos.
@@TinyTechnicalTutorials Great explanation. Wanted to know if it's possible to turn an EC2 into a Hotspot using VPC.