Skip to content

Creates static route for internalPath#1147

Merged
gittiver merged 5 commits intoCrowCpp:masterfrom
CarloDG80:AddStaticRule
Apr 1, 2026
Merged

Creates static route for internalPath#1147
gittiver merged 5 commits intoCrowCpp:masterfrom
CarloDG80:AddStaticRule

Conversation

@CarloDG80
Copy link
Copy Markdown
Contributor

This PR makes easier to add route to static files and static behaviors.

    auto app = crow::SimpleApp();
    
    // Add static route by function
    app.static_file("/home", "home.html");
    // or add static route by MACRO
    CROW_STATIC_FILE(app, "/favicon.ico", "favicon.png");

Add Crow::route_static
Add Crow::static_file
@gittiver
Copy link
Copy Markdown
Member

gittiver commented Mar 8, 2026

misses tests and documentation for new Macro

@CarloDG80
Copy link
Copy Markdown
Contributor Author

Hi, how you suggest:

  • I change TEST_CASE("send_file") to use CROW_STATIC_FILE
  • I update docs/guides/static.md

@gittiver gittiver merged commit a22b13b into CrowCpp:master Apr 1, 2026
22 of 23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants