4 ms·
Caddy is a single file web server as well :) https://caddyserver.com/ https://caddyserver.com/ Admittedly they solve different usecases, where Redbean seems to
by francislavoie 6y ago
Caddy is a single file web server as well :) https://caddyserver.com/ https://caddyserver.com/
Admittedly they solve different usecases, where Redbean seems to want to serve a whole static site as a single file, which isn't currently possible with Caddy, (but you can run `caddy file-server` to serve the current directory as a static site), but it may become possible in the future with Golang's new embed package https://golang.org/pkg/embed/ https://golang.org/pkg/embed/
- mholt 6y agoThat's actually a pretty interesting idea. I wonder if we could make a lite version of Caddy bundled with your website embedded...no need to mess with file systems or permissions or devices and folders to run a static site. Might need some massaging to become a truly pleasant workflow though.
- francislavoie 6y agoYeah - I could see it being part of xcaddy tooling to package up the static assets in the binary :)
- IceWreck 6y agoThe go std library offers the embed package. You can just embed your files and use the std lib's webserver and generate a single file binary. No need for Caddy. All this would be roughly 15 lines of code.
- mholt 6y agoPeople use Caddy for automatic HTTPS, which the std lib does not give you.
- anderspitman 6y agoObviously you don't need to know this but others might not be aware that certmagic is a great middle ground between Caddy and rolling your own ACME.
- kapitalx 6y agoCaddy is cool! Redbean is magic :p Thanks for sharing.
- jart 6y agoCaddy is cool but it has a separate 33mb executable for each operating system. Redbean is a 128kb executable that runs on all platforms so it has fewer moving parts and is 1584x tinier. All the convenience of being able to "just add your assets to the zip executable" wouldn't have been feasible if we needed to repeat that process n times for each operating system.
- francislavoie 6y agoYes of course - like I said, they solve different usecases. Caddy has way, way more features overall to make up for the bigger binary.
- mrmonkeyman 6y agoCaddy is Go. It has 5mb hello worlds. (Which is fine)
- goldenkey 6y agoIs that smile at the end of your first sentence meant to be condescending? You are affiliated with Caddy and ought to mention that when you promote your own software. https://news.ycombinator.com/item?id=16687686 https://news.ycombinator.com/item?id=16687686 This is not a competition. Caddy is not even in the same realm as Redbean. Redbean is a multi-platform binary that doubles as a ZIP. It's roughly 1500 times smaller than Caddy too. > different usecases Right. :)
- francislavoie 6y ago> Is that smile at the end of your first sentence meant to be condescending? What? Of course not! You're reading way too much into that. It's simply enthusiasm. I read about Redbean and it being a single file webserver and the first thing to come to mind is Caddy, as "prior art". Like I said, different usecases; Caddy is a general purpose webserver which has automatic certificate management, H2/H3 support, reverse proxy, file server, a strong plugin system, the list goes on. Of course it'll be bigger in size. Redbean is super cool and does have the advantage in file size and portability, clearly, but it is essentially a single-purpose tool. And there's nothing wrong with that.