Commit c71ac359 authored by James Allenby's avatar James Allenby
Browse files

Better selective examples

parent 7c4f7048
......@@ -23,7 +23,17 @@ int main()
// Match all URLs that contain /profile/ and anything after
// This will also ensure that it only matches GET requests.
server.Get("/profile/.*", [](auto& request, auto& response)
server.Get("/profile/[a-zA-Z]+", [](auto& request, auto& response)
{
response.SetResponseCode(JAMP::Code::HTTP_200);
response.Write("Welcome to the profile section of the website\n\n");
response.Write(request.URI());
response.Close();
});
// Match all URLs that contain /profile/ and anything after
// This will also ensure that it only matches GET requests.
server.Get("/profile/[a-zA-Z]+/edit", [](auto& request, auto& response)
{
response.SetResponseCode(JAMP::Code::HTTP_200);
response.Write("Welcome to the profile section of the website\n\n");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment