added static file example

This commit is contained in:
Farook 2020-10-04 19:29:56 +03:00
parent 24c04c65cf
commit 03f6d6c818

View File

@ -0,0 +1,22 @@
#include "crow.h"
int main()
{
//Crow app initialization
crow::SimpleApp app;
//
CROW_ROUTE(app, "/")
([](const crow::request&, crow::response& res) {
//replace cat.jpg with your file path
res.set_static_file_info("cat.jpg");
res.end();
});
app.port(18080).run();
return 0;
}