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
Cloudflare doesn’t have a bare-hosting option for Rust like you need. Though, does your app just serve static HTML?
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
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
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...
Yeah, Cloudflare doesn’t offer any VMs/Container Hosting, but you can slap Cloudflare on top of another provider’s VMs
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
you can run rust on workers, refactor it with Cursor ide or github copilot
wait so is the idea behind that to write code in Rust, compile it to WASM, and then call that from a Node app?
No clue, just saw this channel 🙂
ah alright. well I hope that isn't what it is because that's hilariously convoluted
#🦀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