Skip to content

Instantly share code, notes, and snippets.

@owensd

owensd/server2.cpp Secret

Created Apr 21, 2017
Embed
What would you like to do?
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