This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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