+doc,htp #18496 file directives docs
This commit is contained in:
parent
4c81e6cbea
commit
2927568225
10 changed files with 155 additions and 64 deletions
|
|
@ -5,7 +5,7 @@
|
|||
package docs.http.javadsl.server;
|
||||
|
||||
import akka.http.javadsl.model.StatusCodes;
|
||||
import akka.http.javadsl.server.*;
|
||||
import akka.http.javadsl.server.Handler1;
|
||||
import akka.http.javadsl.server.values.PathMatcher;
|
||||
import akka.http.javadsl.server.values.PathMatchers;
|
||||
import akka.http.javadsl.testkit.JUnitRouteTest;
|
||||
|
|
@ -39,12 +39,7 @@ public class PathDirectiveExampleTest extends JUnitRouteTest {
|
|||
|
||||
// matches "/admin/user/<user-id>"
|
||||
Handler1<Integer> completeWithUserId =
|
||||
new Handler1<Integer>() {
|
||||
@Override
|
||||
public RouteResult apply(RequestContext ctx, Integer userId) {
|
||||
return ctx.complete("Hello user " + userId);
|
||||
}
|
||||
};
|
||||
(ctx, userId) -> ctx.complete("Hello user " + userId);
|
||||
PathMatcher<Integer> userId = PathMatchers.intValue();
|
||||
pathPrefix("admin", "user").route(
|
||||
path(userId).route(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue