C++ backend URL Routing
currently im writing this web app with my backend being in c++
basically after parsing the http request string I just have a bunch of conditional statements calling relevant "controllers" to handle actions
for example
with controllers which are defined like bellow with some logic
rather than having an increasingly large if else tree for every route im thinking of something like this
where
router[URL][http method] will store the relevant controller
now the major issue im having is not all controllers have the same number of arguments
would anyone be able to help me with a design for my router class to circumvent this?
basically after parsing the http request string I just have a bunch of conditional statements calling relevant "controllers" to handle actions
for example
with controllers which are defined like bellow with some logic
rather than having an increasingly large if else tree for every route im thinking of something like this
where
router[URL][http method] will store the relevant controller
now the major issue im having is not all controllers have the same number of arguments
would anyone be able to help me with a design for my router class to circumvent this?