Skip to content

zYg-sys/simple-cpp-router

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple C++ URI routing library

Requirements

C++11 compiler with regex support

Example usage

    Router router;
    
    router.registerPath("/simple_path");
    router.registerPath("/one/two");
    router.registerPath("/path/with/:dynamic_var");
    router.registerPath("/path/to/:one_var/and/:another_var");
    
    PathMatch match = router.matchPath("/path/to/dynvar_1/and/dynvar_2");
    
    assert(match.pathTemplate() == "/path/to/:one_var/and/:another_var");
    assert(std::string("dynvar_1") == match["one_var"]);
    assert(std::string("dynvar_2") == match["another_var"]);
    

About

Simple URI routing library for C++

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 92.0%
  • CMake 8.0%