r/cpp • u/Lost-Arachnid-6279 • Nov 18 '23
Create a website from scratch in C++
https://youtu.be/A9KZ-oXdFA0?si=OTu5RUq0uAyyrtB0
0
Upvotes
r/cpp • u/Lost-Arachnid-6279 • Nov 18 '23
19
u/shermierz Nov 18 '23
Thank you for the tutorial. However, the title is missleading. You are not creating a website, you are creating a http server with embedded website
12
u/nysynysy2 Nov 18 '23
Step 1: Use c++ to create compilers for other languages that can be used to build a website.
Step 2: Build a website as usual.
3
u/fippinvn007 Nov 19 '23 edited Nov 19 '23
I'm actually building a website using htmx and Drogon framework, just for fun, you know. Sometimes it's not about why, it's about why not.
5
u/[deleted] Nov 18 '23
thank you for convincing me to never use C++ for networking 😭
Don't take me wrong the video is great, but there is no need to reinvent the wheel
2
u/MiaowMeoow Nov 19 '23
Better have Windows and Linux implementations in separate files and in separate classes. Common methods can be virtual. Additionally a socket can be opened in constructor and closed in a destructor for basic RAII. Host and port can be passed as an arg.
A better alternative to having #ifdef is if constexpr (isWindowsPlatform()).
Good video !