Hosting a web server for a personal site

I've built a little HTTP server in Rust that listens for incoming TCP streams and spits out some HTML. My question is: what's the easiest and cheapest way to host this on Cloudflare? Does the free tier of Cloudflare Pages support this usecase? My bandwidth and compute requirements are extremely minimal since I'm just trying to build a personal website and improve my Rust skills. Apologies if this is a noob question, I'm not very familiar with Cloudflare's products.
12 Replies
Hello, I’m Allie!
Cloudflare doesn’t have a bare-hosting option for Rust like you need. Though, does your app just serve static HTML?
Procyon
ProcyonOP4w ago
no, I'd like to have dynamic content like a counter of how many people have visited the site For static content I've found Github Pages and Neocities to be really simple
Hello, I’m Allie!
Ok, so Cloudflare does have a few products that can serve dynamic content. The trouble is, neither of them can serve your Rust app out of the box
Procyon
ProcyonOP4w ago
I mean all I need really is a raw VM like Amazon Lightsail (which I'm also looking into) but I'm hoping to have edge caching for the static parts like images, might be tricky though...
Hello, I’m Allie!
Yeah, Cloudflare doesn’t offer any VMs/Container Hosting, but you can slap Cloudflare on top of another provider’s VMs
Procyon
ProcyonOP4w ago
Well, thanks for the help! Guess I'll be trying that also I would really like bot/ddos protection because I implemented a comments section and it would be cool to have it public-facing
Ryan | Cloneable.ai
you can run rust on workers, refactor it with Cursor ide or github copilot
Procyon
ProcyonOP4w ago
wait so is the idea behind that to write code in Rust, compile it to WASM, and then call that from a Node app?
fry69
fry694w ago
No clue, just saw this channel 🙂
Procyon
ProcyonOP4w ago
ah alright. well I hope that isn't what it is because that's hilariously convoluted
Hello, I’m Allie!
#🦀rust-on-workers allows you to write a Worker in Rust, which is then compiled to WASM. A JS shim is then added by the tooling, but you don't have to do it manually Basically, you can completely avoid touching the JS if you want to
Want results from more Discord servers?
Add your server