Skip to content

Instantly share code, notes, and snippets.

@owensd
Created April 21, 2017 17:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save owensd/c2c30ccf9d9092adabe50c46af85b7c9 to your computer and use it in GitHub Desktop.
Save owensd/c2c30ccf9d9092adabe50c46af85b7c9 to your computer and use it in GitHub Desktop.
fws::service service;
service.get("/v1/api/spells/:name", [](fws::http_request req) {
auto name = req.parameter("name");
if (!name) return fws::http_response();
return spells::api(*name);
});
service.get("/spells/:name", [](fws::http_request req) {
auto name = req.parameter("name");
auto partial = fws::asbool(req.query("partial"));
if (!name) return fws::http_response();
return spells::view(*name, partial);
});
service.run();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment