Skip to content

Instantly share code, notes, and snippets.

@Cylix
Created October 19, 2020 04:47
Show Gist options
  • Save Cylix/89280b1bacc0d7fcd1b86082f3be7acb to your computer and use it in GitHub Desktop.
Save Cylix/89280b1bacc0d7fcd1b86082f3be7acb to your computer and use it in GitHub Desktop.
Reflection in C++14 - Routes Configuration in C++
router.add(Route{ HTTP::Method::GET, "/articles" }, &articles_controller::index);
router.add(Route{ HTTP::Method::POST, "/articles" }, &articles_controller::create);
router.add(Route{ HTTP::Method::GET, "/articles/:id" }, &articles_controller::show);
router.add(Route{ HTTP::Method::PUT, "/articles/:id" }, &articles_controller::update);
router.add(Route{ HTTP::Method::DELETE, "/articles/:id" }, &articles_controller::destroy);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment