You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi someone else on my team has been responsible for build our application that uses Restinio and it's all working well.
However, I need to figure out how to be able to allow users to navigate and view the directory contents of on our system.
The directory is .../public/logs/, which will contain numerous *.csv files.
Please help or offer direction on where to get help. Thanks
ps My next questions will be how to I get the name of a selected file from that webpage, or how can I influence how the HTML code is rendered for each file so that when selected the page navigates to a new route that will open the file or render a new page?
Thanks again.
The text was updated successfully, but these errors were encountered:
RESTinio doesn't provide a functionality to return a list of files in a directory as a HTML page. You have to serve public/logs path by yourself (it may be simpler if you are using express-based router). When you get a HTTP GET request for public/logs you collect a list of files (by using std::filesystem::directory_iterator for example), then you make a HTML page and return it in the response body. Each name in that HTML file will be represented as a reference (something like <a href="https://yoursite/public/logs/some-file.csv">some-file.csv</a>). When a user clicks on that reference in a browser you will get a new HTTP GET request with public/logs/some-file.csv as the target. Then you can handle this request by reading the content of some-file.csv and sending this content back as the response (or you can use sendfile functionality).
Hi someone else on my team has been responsible for build our application that uses Restinio and it's all working well.
However, I need to figure out how to be able to allow users to navigate and view the directory contents of on our system.
The directory is .../public/logs/, which will contain numerous *.csv files.
Please help or offer direction on where to get help. Thanks
ps My next questions will be how to I get the name of a selected file from that webpage, or how can I influence how the HTML code is rendered for each file so that when selected the page navigates to a new route that will open the file or render a new page?
Thanks again.
The text was updated successfully, but these errors were encountered: