Skip to content
suinua edited this page Nov 6, 2018 · 3 revisions

Welcome to the nepuro wiki!

editinf now

Path Variable

"[:pathVariableName]"

To get path variable value.

@Call.path("pathVariableName") String foo

exmaple↓

@Path.get("/Hello/[:name]")
hello(@Call.path("name") String name){
  return Response("Hello $name");
}

Path Variable With RegExp

Place "r" before the [ and path.
r"/r[RegExp:pathVariableName]"

exmaple↓

@Path.get(r"/Plus/r[\d:first]/r[\d:second]")
plus(@Call.path("first") int first, @Call.path("second") int second) {
  return Response.ok("first + second = ${first + second}")..text();
}
Clone this wiki locally