How to run httpd on directory?

ruby code:

ruby -run -e httpd ./ 

[2022-02-09 15:25:38] INFO  WEBrick 1.7.0
[2022-02-09 15:25:38] INFO  ruby 3.0.3 (2021-11-24) [x86_64-linux]
[2022-02-09 15:25:38] INFO  WEBrick::HTTPServer#start: pid=2852006 port=8080

python :

python -m http.server 8080 

Serving HTTP on 0.0.0.0 port 8080 (http://0.0.0.0:8080/) ...

list files , download files in web browser .

I think you want HTTP::StaticFileHandler - Crystal 1.3.2 when used as part of a HTTP::Server - Crystal 1.3.2.

There is however now simple one-word HTTP server implementation in Crystal. In contrast to interpreted languages like Ruby and Python, I think this doesn’t make much sense in a compiled language. In Crystal, you would just build a server executable once and run that instead of compiling again every time you use it.

Btw. I’m using https://github.com/SuperPaintman/serve
Disclaimer: I don’t think it builds with current Crystal version. But it’s rather trivial, really.