drogonframework / drogon

Drogon: A C++14/17/20 based HTTP web application framework running on Linux/macOS/Unix/Windows
MIT License
11.04k stars 1.06k forks source link

How would I serve up a directory listing? #2007

Open timbo100 opened 2 months ago

timbo100 commented 2 months ago

I'm looking for an embedded HTTP server that I can code in C++ , and among other things, be able to define a route that returns a directory listing from .../public/logs/ directory, for example. This directory will contain many .csv files. The end goal is to allow a person to select one of the .csv files and have the result navigate to another specific html file that parameterizes the file name so I can part and display csv file's content as needed.

Also please point where were it's explained how to upgrade to websocket.

Thanks

an-tao commented 2 months ago

This framework does not provide directory and file traversal function, you need to implement it yourself, you could refer to the following project. https://github.com/bridge71/Share-the-Sky Websocket reference: https://github.com/drogonframework/drogon/wiki/ENG-04-3-Controller-WebSocketController