Open Milerius opened 5 years ago
RESTinio hasn't such top-level functionality yet. You have to implement it by yourself by using sendfile
functionality:
https://stiffstream.com/en/docs/restinio/0.5/sendfile.html
An example: https://github.com/Stiffstream/restinio/blob/master/dev/sample/sendfiles/main.cpp
@eao197 Ah ok, it's can be great if we can have such a functionality for serving specific directory for example ! thank's for your example i will try to follow
In golang i simply do:
ServeFiles serves files from the given file system root. The path must end with "/filepath", files are then served from the local path /defined/root/dir/filepath. For example if root is "/etc" and *filepath is "passwd", the local file "/etc/passwd" would be served. Internally a http.FileServer is used, therefore http.NotFound is used instead of the Router's NotFound handler.
(i want to serve the logs file of my server so we can read it online)
i dont find the equivalent with restinio in the documentation :'(